Home >Web Front-end >HTML Tutorial >div css fixed width and centered text left aligned_html/css_WEB-ITnose

div css fixed width and centered text left aligned_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-24 12:28:491687browse

Method 1:

/* CSS Document */

body,html{
margin:0px;
padding:0px;
text-align:center;
background:#e9fbff;
}
#container{
position:relative;
margin:0px;
padding:0px;
width :700px; /*Must have width otherwise it cannot be aligned*/
text-align:left;
background:url(container_bg.jpg) repeat-y;
}

Method 2:

/* CSS Document */

body,html{
margin:0px;
padding:0px;
background:#e9fbff ;
}
#container{
position:relative;
left:50%;
width:700px;
margin-left:-350
margin:0px;
background:url(container_bg.jpg) repeat-y;
}
#banner{
margin:0px;
padding:0px;
}
#links{
font-size:12px;
margin:-18px 0px 0px 0px;
padding:0px;
position:relative;
}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn