Create a web page: center a layer css

Source: Internet
Author: User

The Helper home (www.bkjia.com) provides a method for setting the middle layer of a webpage with only CSS. It's not easy to try again today. Fortunately, the previous pages are still available. The same Code is not easy to use. As a result, we hope to find some clues to delete the segment. Css only deletes this part of the Setting code, which is not easy to use. In javascript, it is still not easy to delete it. After the last deletion, I finally found that the original webpage header is different. It is not easy to use automatically generated by using. NET by default.

Reference content is as follows:
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">

You can use the following transitional document type. So pay attention to this 1.1.

Reference content is as follows:
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml" xml: lang = "en" lang = "en">

The following is the HTML code of the center layer.

Reference content is as follows:
<Div id = "pagebody"> </div>

The following figure shows how to set the center CSS.

Reference content is as follows:
# Pagebody
{
Width: 940px;
Background: # FFF;
Margin: 0 auto;
}

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.