Putting a Border Around Floating Elements

后端 未结 3 791
夕颜
夕颜 2021-02-03 22:13

Say I have something like the following code, where I want to display some text between two images that I am floating left and right.



        
3条回答
  •  别那么骄傲
    2021-02-03 22:37

    In CSS, floated elements do not add height to a parent by default.

    The solution is simply to set overflow: hidden.

    Test Image 2

    Test Text

    fiddle: http://jsfiddle.net/JNets/

提交回复
热议问题