Margin:0 auto is set; why can't it be centered?
cp3
cp3 2018-05-04 16:04:03
0
2
1620

<!DOCTYPE html>

<html>

<head>

<meta charset ="UTF-8">

<title>1. Single-column equal-width layout</title>

<!--Style-->

<style type="text/css" >

.container{

max-width: 960px;<!--Set the maximum width to 960px-->

margin:0 auto;< !--Set the inner block element to be horizontally centered-->

}

.header{

height:50px;

background-color: #21ff80;

}

.main{

height:600px;

background-color:#80007f;

}

.footer{

height:100px;

background-color:#21ff80;

}

</style>


##</head>


##<body>

<h4>Single column, etc. Basic ideas of wide layout: </h4>

<p>1. The head, body and bottom of the page are all placed in a container and set uniformly<br>

2. The sub-blocks in the container only need to set the height

</p>

##<div>

< div>head</div>

<div>body</div>

<div>bottom</div>

</ div>


##</body>





#</html>


cp3
cp3

reply all(2)
cp3

Okay, it’s solved. There is a problem with the comments. I wrote it in Notepad++. I just used the shortcut keys to comment without paying attention.

legend

You only wrote the style, but did not use the style

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template