Some HTML5 and css3 snippets that web developers need to know

Source: Internet
Author: User
Remove the scroll bar of textarea under IE
textarea {    overflow: auto;}
Transparent Effect of full CSS implementation
.transparent {   filter:alpha(opacity=50);   -moz-opacity:0.5;   -khtml-opacity: 0.5;   opacity: 0.5;}...<div class="box transparent">larger content</div>
X-UA-compatible
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame --><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
Internet Explorer condition judgment
<!--[if lt IE 7 ]> <body class="ie6"> <![endif]--><!--[if IE 7 ]>    <body class="ie7"> <![endif]--><!--[if IE 8 ]>    <body class="ie8"> <![endif]--><!--[if IE 9 ]>    <body class="ie9"> <![endif]--><!--[if (gt IE 9)|!(IE)]> for higher than IE9 or non-IE <![endif]-->
Yui font Reset

For more documentation, see Yui developer documentation.
.

/*fonts.css from YUI Library: URL - developer.yahoo.com/yui/ */body { font:13px sans-serif; *font-size:small; *font:x-small; line-height:1.22; }table { font-size:inherit; font:100%; }select, input, textarea { font:99% sans-serif; }
Force display of browser scroll bars
html { overflow-y: scroll; }
Display the hand cursor in the input box
/** label CSS pointer reset **/label, input[type=button], input[type=submit], button { cursor: pointer; }
Alignment of form fields and text labels
/* @group align radio, labels, forms */input[type="radio"] { vertical-align: text-bottom; }input[type="checkbox"] { vertical-align: bottom; *vertical-align: baseline; }.ie6 input { vertical-align: text-bottom; }
Css3 pre-loaded image (s)
div.imgload {   background:url(images/sheet1.gif) no-repeat;   background:url(images/sprites.png) no-repeat;   background:url(images/mybanner.jpg) no-repeat;   margin-left: -99999px;}
Use CSS to flip an image
img.flip {   -moz-transform: scaleX(-1);   -o-transform: scaleX(-1);   -webkit-transform: scaleX(-1);   transform: scaleX(-1);   filter: FlipH;   -ms-filter: "FlipH";}
Rounded corner effects implemented by pure css3
.round{   -moz-border-radius: 10px;   -webkit-border-radius: 10px;   border-radius: 10px; /* future proofing */   -khtml-border-radius: 10px; /* for old Konqueror browsers */}
Min-height in IE
.box {   min-height:500px;   height:auto !important;   height:500px;}
Vertical center
.vcontainer {   min-height: 10em;   display: table-cell;   vertical-align: middle;}
Pull quotation marks similar to the magazine Style
.pullquote {   width: 220px;   float: right;   margin: 5px;   margin-left: 25px;   font-family: Georgia, "Times New Roman", Times, serif;   font: italic bold #333;}
Fancy symbols
.amp {    font-family: Baskerville, 'Goudy Old Style', Georgia Palatino, 'Book Antiqua', serif;    font-style: italic;    font-weight: normal;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.