Welcome to our Graphic Design Forums! Your Design Forums has active graphic design forums where community members discuss graphic design related topics.
The Best of WordPress Freelance Folder Sub-Studio Design Blog Go Web Admin UPrinting.com Design Hide




Go Back   Graphic Design Forums > Web Design Forums > General Web Design Discussion > Front End Web Development

Reply
 
Thread Tools Display Modes
Old 03-26-2008, 01:27 PM   #1
fumblies
Designer
 
Join Date: Jan 2008
Posts: 50
Default Help! Gaps between divs?

I'm not sure what I did wrong but there is a gap between the div tag from my main content div and the footer div as shown below:



There wasn't a gap in the DW preview, but when I test it out in Safari and Firefox, there it is.

By right, that should not be a problem, since my footer is just a blank white rectangle so the gap would not be seen if the background color of my wrapper div is also white. But I'm also using a background image in my wrapper div, so is that the reason why the white background doesn't show?

I'm new with the table-less css method of creating websites, so I need some help from you css experts.Thanks!
fumblies is offline   Reply With Quote
Old 03-26-2008, 01:53 PM   #2
Aarlev
Web Designer
 
Aarlev's Avatar
 
Join Date: Jan 2008
Location: London
Posts: 325
Default

Can you post the code as it's really hard to help you without it? There's no problem in having a background-image and background-color in the same DIV though.
__________________
//PORTFOLIO\\
Aarlev is offline   Reply With Quote
Old 03-26-2008, 04:52 PM   #3
fumblies
Designer
 
Join Date: Jan 2008
Posts: 50
Default

Html:
Quote:
<html>
<head>
<title>content</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
<!--
body {
background-image: url(images/vhardamonogram.jpg);
background-repeat: repeat;
background-color: #3C135E;
}
-->
</style>
<link href="vhardacontent.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="container">
<div id="header">
<div align="center"><a href="gallery.html"><img src="images/vardalogo.png" alt="Vharda" width="193" height="145" border="0"></a></div>
</div>
<div id="navigation">
</div>
<div id="content">
<h1 class="heading1">Lorem Ipsum</h1>
<p class="maintext">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut
laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure
dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla
facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit
augue duis dolore te feugait nulla facilisi.</p>
</div>
<div class="maincontent" id="footer">
<div align="center" class="maintext">Copyright &copy; <a href="mailto:your@address.here">Vharda</a>.</div>
</div>
</div><!--container end-->
</body>

</html>
css:
Quote:
.maintext {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 12px;
color: #663300;
}
.heading1 {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 18px;
font-weight: bold;
color: #FFFFFF;
}
#container {
width: 800px;
background-color: #FFFFFF;
background:url(images/content.jpg) no-repeat;
margin: 0 auto;
}
#header {
height: 163px;
background: url(images/header.jpg) no-repeat;
}
#navigation {
height: 20px;
background: url(images/navigation.jpg);
}
#content {
height:488px;
width: 600px;
padding-left: 46px;
}
#footer {
background: url(images/background.jpg) no-repeat;
height: 49px;
}
fumblies is offline   Reply With Quote
Old 03-26-2008, 08:26 PM   #4
Aarlev
Web Designer
 
Aarlev's Avatar
 
Join Date: Jan 2008
Location: London
Posts: 325
Default

Remove the height on #content. That should solve it.
__________________
//PORTFOLIO\\
Aarlev is offline   Reply With Quote
Old 03-26-2008, 09:14 PM   #5
Aarlev
Web Designer
 
Aarlev's Avatar
 
Join Date: Jan 2008
Location: London
Posts: 325
Default

Oh and remove all background images apart from the one on #container.

Set the background image like this on #container..

background:url(folder/yourname.fileformat) no-repeat top;

and then set the background-color to #fff.

Also I'd remove the internal CSS and put it in the external stylesheet, just easier for you. And then you could do it like this.

HTML:

<div id="container">
<div id="header"></div>
<div id="navigation"></div>
<div id="content"></div>
<div id="footer"></div>
</div>

CSS:
html {
margin:0;
padding:0;
}

body {
margin:0;
padding:0;
background-color:#3C135E;
text-align:center;
}

#container {
width: 800px;
background-color: #fff;
background:url(images/content.jpg) no-repeat top ;
margin: 0 auto;
}

#header {your attributes here}

#navigation {your attributes here}

#content {your attributes here}

#footer {
background-color:#fff;
width:800px;
height:49px;
}

No need to put a DIV inside your footer either. You could just put a P with a class in there instead or just put your font styles in #footer.

Hope this helps you, otherwise just ask.
__________________
//PORTFOLIO\\

Last edited by Aarlev : 03-26-2008 at 09:17 PM.
Aarlev is offline   Reply With Quote
Old 03-29-2008, 11:19 AM   #6
fumblies
Designer
 
Join Date: Jan 2008
Posts: 50
Default

Thanks a lot for the help! I really appreciate it! I tried doing this and it worked for a while, but then after tweaking it a little, it stopped working again and the gap came back. I don't know where the problem lies now. I've decided to use just a white bg color for my footer instead of a white rectangle image.

So this is my css right now:
Quote:
html {
margin:0;
padding:0;
}

body {
margin:0;
padding:0;
background-color:#3C135E;
background:url(images/vhardamonogram.gif);
}
.maintext {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 12px;
color: #663300;
}
.heading1 {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 18px;
font-weight: bold;
color: #FFFFFF;
}
.heading2 {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 14px;
color:#663300;
font-weight: bold;
}
#container {
width: 800px;
background-color: #FFF;
background: url(images/content.jpg) no-repeat top;
margin: 0 auto;
}
#header {
height: 163px;
background: url(images/header.jpg) no-repeat;
}
#navigation {
height: 20px;
background: url(images/navigation.jpg);
}
#content {
width: 600px;
padding-left: 46px;
}
#footer {
background-color:#fff;
width:800px;
}
HTML:
Quote:
<html>
<head>
<title>content</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
<!--

-->
</style>
<link href="vhardacontent.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="container">
<div id="header">
<div align="center"><a href="gallery.html"><img src="http://www.yourdesignforums.com/images/vardalogo.png" alt="Vharda" width="193" height="145" border="0"></a></div>
</div>
<div id="navigation">
</div>
<div id="content">
<h1 class="heading1">About Us </h1>
<p class="maintext">/*a few paragraphs of lorem ipsums*/
<p class="heading2">&nbsp;</p>
</div>
<div class="maincontent" id="footer">
<div align="center" class="maintext">Copyright &copy; <a href="mailto:your@address.here">Vharda</a>.</div>
</div>
</div><!--container end-->
</body>

</html>
Here's a screenshot once again...

Last edited by fumblies : 03-29-2008 at 11:33 AM.
fumblies is offline   Reply With Quote
Old 03-31-2008, 10:40 AM   #7
Aarlev
Web Designer
 
Aarlev's Avatar
 
Join Date: Jan 2008
Location: London
Posts: 325
Default

You're welcome mate.

It's because the footer is inside the main container. If you want the footer inside the main container just put a DIV inside the main container before the footer with your main content inside it. Does that make sense?

Anyways I've created a quick example for you here to illustrate it better. Just view the source and lift the code if you need to.

http://andersbschjorring.com/Soeren/index.htm

The CSS is here..

http://andersbschjorring.com/Soeren/fumblies.css
__________________
//PORTFOLIO\\

Last edited by Aarlev : 03-31-2008 at 11:08 AM.
Aarlev is offline   Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 06:50 PM.

 

Contact Us | Advertise | Archive | Resources |

My Other Websites

Graphic Design Resources | T Shirt Blog | How to Start a Clothing Line | Design Gallery

Our Friends

3DS Max and Photoshop Tutorials | Vandelay Design | Urban Art and Design | Online Printing | Blog.SpoonGraphics | Free Vectors

| Digg for Designers | Web Design Blog

Design by: vBulletin Skins Zone Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0