Remove margins in HTML5
I can't remove the margins up, down, left and right frmo tag . What am I doing wrong?
HTML5 You can access to the code in these address: http://www.demo31.com/validacion/personal
CSS
@CHARSET "utf-8";
/* Makeshift CSS Reset */
*{
margin: 0 auto;
padding: 0 auto;
}
/* Tell the browser to render HTML 5 elements as block */
header, footer, aside, nav, article, section{
display: block;
}
html, body{
margin: 0 auto;
padding: 0 auto;
font-family: Calibri, Verdana, Helvetica, Tahoma, Sans-Serif;
text-align: justify;
font-size: 66%;
background-color: #1d293f;
top: 0px;
font-size-adjust: none;
font-style: normal;
font-variant: normal;
font-weight: normal;
font-height: normal;
}
header, h1{
margin: 0 auto;
padding: 0;
border: 0;
/*margin: -7px -1px -4px -1px;*/
overflow: hidden; /*Remove top-margin page*/
}
header{
width: 80%;
background-color: #fbf585;
}
section{
margin: 0 auto;
padding: 0 auto;
width: 80%;
background-color: #ffffff;
}
section > h1{
width: 80%;
background-color: #CCCCCC;
border-spacing: 0px;
font-size: 10em;
letter-spacing: 0.25em;
text-align: left;
}
Removing all margins is done margin: 0; not margin: 0 auto;
Once you define:
* {
margin: 0;
padding: 0 auto;
}
You never need to set these properties again for any other element.
* is everything.
auto; doesnt work on padding, you need to set 0.
你只需要这样做
body{
margin: 0px;
padding: 0px;
}
链接地址: http://www.djcxy.com/p/15354.html
上一篇: HTML文本输入只允许数字输入
下一篇: 删除HTML5中的边距
