Summary of "CSS Cookbook" notes (iv)

Source: Internet
Author: User

Page elements

Use the Text-align property to center the text in block-level elements. When Margin-left and Margin-right are set to auto, the element is centered relative to the parent element. However, some of the newer browsers that are popular today are not able to render this appearance correctly, such as IE5 and Netscape Navigator. If you use the th element in an HTML table, the contents of the cell are centered by default. On the basis of horizontal centering, you can center vertically and need to use the Position property. That

Position:abasolute;top:50%;left:50%;margin-top:xx;margin-right:xx;height:xx;width:xx;

The office-to-position allows the element to be removed from the document's current limit and displayed in any expected position.

If you want the horizontal line to be centered on the Safari browser, set Margin-left and margin-right to auto, but for Mozilla, Firefox, navigator, and IE, the margin setting is optional. When changing the color of the HR element, given the robustness of the Web page across browsers, you should set both the color and Background-color properties, because Ie/win only recognizes the color attribute of the HR element, while Safari, Mozilla, The Background-color property is supported by Firefox and Netscape Navigator 6+.

Summary of "CSS Cookbook" notes (iv)

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.