CSS - Keep text under an image

后端 未结 2 1646
面向向阳花
面向向阳花 2021-01-29 02:08

I\'m trying to create a simple gallery of pictures and I was told to use \"float: left\", but when I do all the text from my footer shoots up to the first image. I\'ve been sear

2条回答
  •  孤独总比滥情好
    2021-01-29 02:33

    you need to clear any floats. So after the floated elements you can add this class to your footer and to your the parent of your floated divs, #txt1, .clearfix:after:

    .clearfix:after {
       clear: both;
       content: ".";
       display: block;
       height: 0;
       visibility: hidden;
    }
    

    or you can just add a div with clear:both above your include of footer.php:

提交回复
热议问题