Home > Web Front-end > HTML Tutorial > Questions about clearing floats_html/css_WEB-ITnose

Questions about clearing floats_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:13:41
Original
1108 people have browsed it

Dear seniors, I am a newbie. When I look at the web page template code, I often add a
under

    , and then set br {clear:both;display:none;} in the css. Why? Set up like this? I tried to remove this code block and it seems that the web page has no change. Why not directly set clear: both; on the next element?


    Reply to the discussion (solution)

    Because you will find that line breaks will occur when setting br. When setting br after li, you will find that there will be a blank line. Blank, so let him hide. As for deletion not responding, that's probably because your width is enough. Or abnormal conditions are not met. Set on next element? ? ? ? ? What should you do if your next element floats? It is recommended that the poster increase the bonding rate

    .clearfix:after{content:"Charry";height:0;clear:both;visibility:hidden;display:block;}.clearfix{display:inline-block;} /* Hides from IE-mac \*/* html .clearfix{height:1%;}.clearfix{display:block;} /* End hide from IE-mac */q:before,q:after {content:”;}abbr,acronym { border: 0;}
    Copy after login



    If the next element needs to be floated, you can use clear to clear the floating effect of the previous element, and then set float, right? hehe. . . I am a beginner, please give me some advice.

    If the next element needs to be floated, you can use clear to clear the floating effect of the previous element, and then set float, isn't that okay? hehe. . . I am a beginner, please give me some advice.

    Do you set a clear float on an element? ? ? Two floating categories belonging to the same category will be overwritten. . . . . . . .

    If the next element needs to be floated, you can use clear to clear the floating effect of the previous element, and then set float, isn't that okay? hehe. . . I am a beginner, please give me some advice.

    Do you set a clear float on an element? ? ? Two floating categories belonging to the same category will be overwritten. . . . . . . .

    As I said before, the poster will increase the bonding rate. . You can’t lose your character

    Thanks for the advice. hehe. I'll pay attention. . .

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template