Home >Web Front-end >HTML Tutorial >Some techniques in div csS and browser-compatible methods_html/css_WEB-ITnose

Some techniques in div csS and browser-compatible methods_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:28:14998browse

(1) For a layer with floating layers, the main layer should use OVERFLOWER: HIDDEN to eliminate other external effects caused by floating inner layers.

For example:

                  <p class="sycode">                 <     div id     =     "     main1     "     >           <     div id     =     "     son1     "      style     =     "     float:left; display:inline     "     >     aa     </     div     >          </     div     >          <     div id     =     "     main2     "      style     =     "     margin-top:10px;     "     >      main2内容                                                       </     div     >                  </p>

At this time, if MIAN1 does not add OVERFLOWER: HIDDEN, the MARGIN-TOP of MAIN2 will have no effect. The reason is the floating element SON1 caused by the impact.

display:inline is to be compatible with IE6's floating MARGIN, which will generate double the MARGIN value. Of course, there are other ways to eliminate the influence of FLOAT, which is to add a DIV after the floating element to make it CLEAR: LEFT, RIGHT, BOTH

(2) For floating LI, arrange it in multiple rows and columns. If so, LI should refer to height and width. The height is specified because if the height is not specified, if the number of lines of text in the LI in the front row is different, the LI in the second row will sink.

Statement:
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