Explanation of Yui grids CSS

Source: Internet
Author: User

Grids CSS in Yui has three parts worth your attention and learning:

1. layout idea: using the "negative margin (negative margins)" technology

For details, see creating liquid layouts with negative margins.

2. Use EM: when the user changes the font size, the width is also changed.

Tip: divide the width with 13 pixels (keep decimal points to kilobytes), while IE browser uses 13.333.

/* 750 centered, and backward compatibility */#doc {width:57.69em;*width:56.251em;min-width:750px;}

  • 57.69 = 750/13
  • 56.251 = 750/13 .333

Note:The article setting page width with Yui grids mentions that the EM in IE is the width divided by 13 and multiplied by. 9759. Why is the width of 750px in IE in the current Yui source code 56.301em (750/13*0.9759).

This algorithm will be replaced with the new algorithm in the next version of Yui (IE browser uses 13.333 ).

3. Clear the floating Layout

For non-ie browsers:

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

For ie browsers, Zoom: 1 is used to trigger haslayout. But for this explanation of Nate koechley:

Zoom is a non-valid attribute and so you'll see warnings when you validate your CSS. I'm aware of that and think it is an acceptable tradeoff.

I agree with his ideas:I think it is an acceptable tradeoff.

Related Article

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.