Gap Between Image and Div

This is a discussion on "Gap Between Image and Div" within the Web Page Design section. This forum, and the thread "Gap Between Image and Div are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 18th, 2005, 21:45
New Member
Join Date: Jun 2005
Location: The Land of the Free
Age: 19
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Gap Between Image and Div

My website is located at http://myrrh.namelessface.net

Note the tiny gap between the header and the content?
I cannot get rid of it. I've tried everything I can think of.

The css is remote-linked from http://myrrh.namelessface.net/style.css
The only PHP on the page is to add the CuteNews stuff.
Here's the code for the index.php page:
Code: Select all
<HTML>

<head>
<title>Rachelle's Trip Over the Pond</title>
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
<link REL="stylesheet" TYPE="text/css" href="style.css">
</head>

<body>
<center>[img]pizza.gif[/img]

<div id="cn">
<?php 
$number = "5";
include('./cutenews/show_news.php'); 
?>
</div id="cn">

</center>

</body>

</HTML>
Reply With Quote

  #2 (permalink)  
Old Aug 19th, 2005, 03:00
Junior Member
Join Date: Aug 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Your code works in FireFox. The problem is actually with IE. Here is what I did:

move <div id=cn> to the top just under the body tag. That removes the break that IE puts in.

<body>
<div id="cn">
<center>[img]pizza.jpg[/img]

Now that you did this you have to re-center your page.
So then do a couple style sheet changes:

In your body style add: text-align: center;

body { font-size: 10px; font-family: verdana; padding: 0px; margin: 0px;
scrollbar-3dlight-color: #FFFFFF;
scrollbar-arrow-color: #000000;
scrollbar-base-color: #FFFFFF;
scrollbar-darkshadow-color: #FFFFFF;
scrollbar-face-color: #FFFFFF;
scrollbar-highlight-color: #777777;
scrollbar-shadow-color: #777777;
scrollbar-track-color: #FFFFFF;
font-family: verdana; font-size: 10px;
background-color: #333333;
text-align: center;
}

In #cn {
change your margin to margin: auto;

#cn { width: 500px; border-left: 1px solid #000000; border-right: 1px solid #000000; padding: 0px; margin: auto; background-color: #FFFFFF; text-align: justify; }

You could get rid of your main <center> tag too. And you should try not to use a table for formatting but just rely on <div> tags and styles. They take a while to learn though. I still use tables too if I'm in a hurry.
Reply With Quote
  #3 (permalink)  
Old Aug 19th, 2005, 16:49
New Member
Join Date: Jun 2005
Location: The Land of the Free
Age: 19
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
I knew the problem was with IE. I don't have FireFox, but I've used it in the past.


The problem with placing the header image in the div is the div's borders.
The image will have double-width borders on each side.

I'll try placing both the image and CuteNews into two seperate divs.

CuteNews came all ready coded in tables. It's difficult to break them out.

Thank you for your help, Raptor.
Reply With Quote
  #4 (permalink)  
Old Aug 20th, 2005, 06:07
Tim356's Avatar
Reputable Member
Join Date: Nov 2003
Location: Australia
Age: 25
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Tim356
I actually find it easier to read with that tiny space - other wise the text is way too close to the edge (even though the text is still right on the edge, having the header that little bit further away makes it seem like it's not).
Reply With Quote
  #5 (permalink)  
Old Aug 20th, 2005, 09:12
Junior Member
Join Date: Aug 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Try putting the image up top into its own div tag. I remember now that DIVs are not supposed to have vertical breaks between them, so this makes them flush.

<center><div style="background-color: #333333"></div>
Reply With Quote
  #6 (permalink)  
Old Aug 20th, 2005, 18:11
New Member
Join Date: Jun 2005
Location: The Land of the Free
Age: 19
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
I tried putting the header image in its own DIV. The result was disastrouous. The DIV took over the whole page, spawning white space and spewing mis-aligned text.
I'm pretty sure I had my code right, but whatever, the site looks fine now.

Thank you, everyone, for your help.
Reply With Quote
Reply

Tags
gap, between, image, div

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Treating an image with <div> tags like a normal image mikeym Web Page Design 2 Mar 1st, 2008 15:28
[SOLVED] multiple image rollover not restoring image snappy JavaScript Forum 4 Nov 5th, 2007 14:38
Image gallery not displaying enlarged image AdRock PHP Forum 15 Sep 1st, 2006 11:31
Background image overlaping footer image at bottom of div lw_d Web Page Design 4 Mar 21st, 2006 00:27
how can i create a wireframe image from a solid image of som benbacardi Graphics and 3D 5 May 22nd, 2004 11:05


All times are GMT. The time now is 03:36.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43