CSS中的body的默认margin_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:38:37
Original
1181 people have browsed it

CSS中的body的默认margin

一般浏览器中都对body标签进行默认的margin设置为8px,当然,不同的浏览器会设置成不同的值,它是由浏览器的user-agent-stylesheet提供的,有些浏览器的user-agent-stylesheet可以由用户进行修改,而有的浏览器则不可以,所以开发人员不能依靠此来修改浏览器的默认设置。如果我们要修改body的默认值,只要覆盖其css样式即可:

body {  margin: 0px;  padding: 0px;  ...}
Copy after login

如果要使在不同的浏览器上设置一样的默认值,我们使用normalize.css即可保持一致了。

版权声明:本文为博主原创文章,未经博主允许不得转载。

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!