Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-03-2012, 02:06 PM   PM User | #1
tarasmuz
New Coder

 
Join Date: Oct 2012
Location: Edinburgh
Posts: 10
Thanks: 3
Thanked 0 Times in 0 Posts
tarasmuz is an unknown quantity at this point
Question Annoying white line at the top of the web-site

Hello again. I got a small white annoying line at the top of the web-site. It also creates a massive white space on the right. I have no idea where it is coming from. Can someone please help me with this issue?

Screenshot:



HTML:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JFM</title>
<link rel="icon"  type="image/ico" href="favicon.ico" />
<link href="css/styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="whole_site_container">

	<div class="top_blue">
	</div>
	
</div>
</body>
</html>
CSS:

Code:
@charset "utf-8";
/* CSS Document */

.whole_site_container {
	width: 1000px;
	margin-right: auto;
	margin-left: auto;	
}

.top_blue {
	width: 2000px;
	height: 100px;
	background-color: #01A4A4;
	}
Thank you!
tarasmuz is offline   Reply With Quote
Old 10-03-2012, 02:10 PM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,607
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
This is the default viewport background color. The body element has a default margin or padding which you need to remove in the first place:
Code:
body {
  margin: 0;
  padding: 0;
}
And then you assigned your div a fixed width so no wonder that the default background color of the page is visible at the right if your viewport is larger than that specified width.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Users who have thanked VIPStephan for this post:
tarasmuz (10-03-2012)
Old 10-03-2012, 02:18 PM   PM User | #3
tarasmuz
New Coder

 
Join Date: Oct 2012
Location: Edinburgh
Posts: 10
Thanks: 3
Thanked 0 Times in 0 Posts
tarasmuz is an unknown quantity at this point
Thank you!
tarasmuz is offline   Reply With Quote
Reply

Bookmarks

Tags
css, html

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:02 PM.


Advertisement
Log in to turn off these ads.