简体   繁体   中英

CSS <div> styling

http://jsfiddle.net/Zmpyv/6/

I have a page, where I use <div> to style the sheet. The problem is that it creates a border around the page. How can I remove this border? Check out the jsfiddle to see what I mean. I am using position: static; I do not want to use fixed because then the page won't scroll correctly.

Perhaps you're just talking about the native margin on <body> . Try this;

body {
    margin: 0;
}

Check out http://jsfiddle.net/Zmpyv/8 where I added the above CSS to your demo.

To avoid spending time fighting silly things like this, I recommend you have a look at normalize.css which applies this style for you, along with fixing a host of other discrepancies between browsers and in my opinion gives you a better starting point when authoring CSS.

Try setting this in div.

border:none

This will remove the border of any element..

<div class="headerClear" /></div>

see this div has unexpected close the right method is

<div class="headerClear"></div>

replace with this and add this to your css

body{ margin:0px;}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM