Common browser kernel engines and specific applications:
*and_, ie6 can recognize;
* , ie6, ie7 can recognize;
!important , indicating high priority, ie7 and above, firefox supports it, ie6 recognizes it !important style attribute, but does not know the priority of !important;
-webkit-, for safari, chrome browser kernel CSS writing method
-moz-, the CSS writing method for the firefox browser kernel
-ms-, the CSS writing method for the ie kernel
- o-, CSS writing method for Opera kernel
如果只让ie6看见用 *html .head{color:#000;} 如果只让ie7看见用 *+html .head{color:#000;} 如果只让ff看见用: root body .head{color:#000;} 如果只让ff、IE8看见用 html>/**/body .head{color:#000;} 如果只是不让ie6看见用 html>body .head{color:#000;} 即对IE 6无效 如果只是不让ff、IE8看见用 *body .head{color:#000;} 即对ff、IE8无效
<span class="pun">.<span class="pln">div1<span class="pun">{</span></span></span>
##*<span class="pun">position<span class="pln">:<span class="pun">relative<span class="pln">;<span class="pun"></span></span></span></span></span>
##-moz<span class="pun">-<span class="pln">background<span class="pun">-<span class="pln">size<span class="pun">:<span class="pln">50<span class="pun">%;<span class="lit"><span class="pun"></span></span></span></span></span></span></span></span></span>
ms-<span class="pun">content<span class="pln">-<span class="pun">zoom<span class="pln">-<span class="pun">limit<span class="pln">-<span class="pun"> max<span class="pln">:<span class="pun">50<span class="pln">%;<span class="pun"><span class="lit"><span class="pun"></span></span></span></span></span></span></span></span></span></span></span></span></span>
-box<span class="pun">-<span class="pln">shadow<span class="pun">:<span class="pln">5px<span class="pun">10px<span class="pln">20px<span class="pun">#f0f;<span class="lit"><span class="lit"><span class="lit"><span class="com"></span></span></span></span></span></span></span></span></span></span></span>
##}
##.
<span class="pun"><span class="pln"><span class="pun"></span></span></span>##position
:
; <span class="pln"><span class="pun"><span class="pln"><span class="pun"><span class="pln"><span class="pun"></span></span></span></span>#}</span></span>
<br/>
First question: Width issue
A div with a height of 30px displays the upper left corner by default. If you want to center it vertically, you can add a line-height:30px; style. If you want it to be at the bottom, modify line-height
The larger the value, the lower. In order to prevent it from bursting, you need to give another style overflow:hidden;
Set three styles for block-level objects to solve the browser default value: width and height overfl
Tips for displaying ellipsis after the content in LI exceeds the length
This technique is applicable to IE and OP browsers
li {##width:200px; white-space:nowrap;
text-overflow:ellipsis;
-o-text-overflow:ellipsis;
overflow: hidden;
}
Why IE cannot set scroll bars in web standards Color The solution is to replace the body with html
html { scrollbar-face-color:#f6f6f6;
scrollbar- highlight-color:#fff;
scrollbar-shadow-color:#eeeeee;
scrollbar-3dlight-color:#eeeeee;
scrollbar-arrow-color:#000;
scrollbar-track- color:#fff;
scrollbar-darkshadow-color:#fff;
}
Why can’t I define a container with a height of about 1px This problem under IE6 is caused by the default line height, and there are many solving techniques, such as: overflow:hidden zoom:0.08 line-height:1px
display:block;
height:0;
clear:both;
visibility:hidden;
}
.clearfix {
display :inline-block;
}
/* Hide from IE Mac */
.clearfix {display:block;}
/* End hide from IE Mac */
/* end of clearfix */
Or set it like this: .hackbox{ display:table; //Display the object as a block element-level table}
The above is the detailed content of Example explanation of css compatibility writing method. For more information, please follow other related articles on the PHP Chinese website!