Some experience with CSS compatibility

Source: Internet
Author: User
Keywords Website construction

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

In the layout of Web pages, CSS compatibility issues, I believe it is the most headache for each web page production staff, here only to share my personal experience.

Web pages can be divided into 3 parts, head (header), main part (main) and footnotes (footer), in order to avoid large compatibility problems, you can set the header and footer a good height, and then add Overflow:hidden; , the main section is set to the width, the same plus overflow:hidden, so that at least to ensure that the overall layout of the page will not be disorderly, the main part is divided into left and right sidebar, can also be appropriately added overflow:hidden; avoid large compatibility problems.

Overall layout part compatibility problem solved, Next is CSS initialization, generally will add the following attributes:

* {padding:0px; margin:0px} makes it necessary to initialize the internal and external margins of each page element by 0 pixels, and the browser's default interior and outer margins.

The picture on the img {border:none} page has a border of 0, some of which have a border, some of which are not, and for security to be set to 0, you can set it in a different class.

body{

font:12px "Song Body", Arial,verdana,tahoma;

Background: #ffffff;

Set default font style and page background color, not all browsers default background colors are white

Vertical-align:middle; This property defines the vertical alignment of the baseline of an element in the row relative to the baseline of the row in which the element is located. Allows you to specify a negative length value and a percentage value. This causes the elements to be reduced rather than elevated. In a table cell, this property sets the alignment of the contents of the cell in the Cell box.

To this step, the site construction of most of the compatibility problem can be solved, there are some small details will be referred to the CSS hack.

This article belongs to the music (color) handwritten original, only on behalf of personal opinion, reproduced please indicate from Www.web-color.net Respect original thanks to cooperate with

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.