Layout Tips----Center your head and backbone content

Source: Internet
Author: User

When you write a layout, make sure that the header or Landscape menu and the main content center, you can define a style, such as:

<style>

. container{

width:980px;

margin:0 Auto;

}

</style>

The head and Body section styles are placed in a label with this style:


<! DOCTYPE html>

<meta charset= "UTF-8" >

<title></title>

<style>

body{

margin:0 Auto;

Resolving body border issues

}

. header{

height:48px;

background-color:red;

}

. body{

Background-color: #dddddd;

}

. container{

width:980px;

margin:0 Auto;

}

</style>

<body>

<div class= "Header" >

<div class= "container" >

<a> Head Content </a>

</div>

</div>


<div class= "Body" >

<div class= "container" >

<p> Backbone Content </p>

<p> Backbone Content </p>

<p> Backbone Content </p>

<p> Backbone Content </p>

</div>

</div>

<div class= "Footer" ></div>

</body>

Display effect:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/87/25/wKiom1fVYV7QTDdwAAAz5W3UIW4625.png "title=" Center display. png "alt=" Wkiom1fvyv7qtddwaaaz5w3uiw4625.png "/>

This article from "Flat Light is true" blog, please be sure to keep this source http://ucode.blog.51cto.com/10837891/1851768

Layout Tips----Center your head and backbone content

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.