/    Sign up×
Community /Pin to ProfileBookmark

Getting white space on left when using 100% width?

I am a complete noob to CSS…well about 1 day into my CSS career..lol

I have the following code to test setting up a layout that has a header, 3 columns and a footer. Not that this code does that but as you can see from the code that is where I will be going.

[CODE]<STYLE TYPE=”text/css”>

#header {
position:absolute;
top:0px;
left:0px;
width:100%;
background:#FFF;
height:60px;
border:1px solid #000;
}

</STYLE>
</head>

<body>

<div id=”header”> <h1>LAYOUT TECHNIQUES: 3 columns, the holy grail</h1></div>

</body>
</html>[/CODE]

When I preview the page there is about a 10px gap on the right hand side of the screen. It is really frustrating me as I was thinking I could design my site without tables and get it to cover 100% width.

Does anybody know how to correct this? Am I doing something wrong?

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@DaveSWJul 05.2004 — you need to set the body not to have any margins or padding:

body {

margin: 0;

padding: 0;

}

Or is that part of the code you haven't posted?
Copy linkTweet thisAlerts:
@bradlesauthorJul 05.2004 — Thanks a heap.

That fixed it.
Copy linkTweet thisAlerts:
@DaveSWJul 05.2004 — ?
×

Success!

Help @bradles spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...