iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > HTML, XHTML and CSS

Reply
 
LinkBack Thread Tools
Old August 28th, 2008, 06:13 PM   #1
New Member
 

Join Date: Aug 2008
Location: Cupertino, CA
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 MeruFM is on a distinguished road
div after img creates unwanted spacing only in firefox

15 minutes into coding, I find this problem that's so ridiculously simple yet unfix-able with my current knowledge.

There's a spacing between the images for my nav buttons and the new div I made for my content.
The problem only appears in firefox.
I'll appreciate any help, even a hack would work.

Edit: Opera also has the spacing. Maybe it's IE doing something wrong. Still looking for a fix to it though.
Edit again: I found a temporary fix by making the margins into negatives. But then that screws up IE. This is really starting to annoy me. I now see the importance of the Acid Tests.



Html
Code:
<body>
<div id="center">

<div id="navbar">
     *images for navigation*
</div>

<div id="content">
    <div id="iframe">
    *content*
    </div>
</div>

</div>

</body>
CSS Code
Code:
body {
    margin:0px;
    padding:0px;
    background-color:#333333;
    }
    
/*styles*/
#center {
    margin:150px auto;
    width:780px;
    height: 500px;
    }
    
#navbar {
    width:780px;
    height: 90px;
    }
    
#content {
    background-image: url(../images/cover_r4_c1.png);
    width: 780px;
    height: 410px;
    }

Last edited by MeruFM; August 28th, 2008 at 06:39 PM..
MeruFM is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old August 28th, 2008, 07:09 PM   #2
Most Reputable Member
 

Join Date: May 2007
Location: Cornwall, England
Posts: 1,422
Blog Entries: 8
Thanks: 18
Thanked 14 Times in 14 Posts
Rep Altering Power: 0 Jack Franklin will become famous soon enough
Re: div after img creates unwanted spacing only in firefox

On the #navbar and #content add:

margin: 0;
padding: 0;
__________________
Yours is the Earth and everything that's in it
And - which is more - you'll be a Man my son!
Jack Franklin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old August 28th, 2008, 07:17 PM   #3
New Member
 

Join Date: Aug 2008
Location: Cupertino, CA
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 MeruFM is on a distinguished road
Re: div after img creates unwanted spacing only in firefox

Quote:
Originally Posted by Jack Franklin View Post
On the #navbar and #content add:

margin: 0;
padding: 0;
Thanks for trying but it didn't help.

I actually add * {padding: 0; margin: 0; border: 0;} to the top of all css as a habit.

Edit:
Fixed it.
Added "float: left;" to

#content {}

I don't get why but it worked. I guess it's just a requirement to remove margins from div tags.

Last edited by MeruFM; August 28th, 2008 at 11:17 PM.. Reason: Finished
MeruFM is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old August 29th, 2008, 11:21 AM   #4
Elite Veteran
 

Join Date: Aug 2005
Location: That Place
Posts: 2,077
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
Rep Altering Power: 0 moojoo will become famous soon enough moojoo will become famous soon enough
Re: div after img creates unwanted spacing only in firefox

floating just takes the element out of the normal document flow. It does not directly affect margins or padding.
__________________

moojoo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
CSS 'clear float' creates too much gap cdarnbor HTML, XHTML and CSS 1 July 6th, 2008 08:44 PM
IE Browser Creates Problem sakibonline HTML, XHTML and CSS 1 August 8th, 2007 08:57 AM
Extra line spacing in Firefox vs IE bgoo HTML, XHTML and CSS 6 April 15th, 2007 08:17 PM
Page creates horizontal scroll bar in IE leebridgewater HTML, XHTML and CSS 1 March 5th, 2006 05:23 AM
Firefox creates huge gap? shifts down. ElmerFud3 HTML, XHTML and CSS 1 December 14th, 2005 10:41 AM


Search Engine Optimization by vBSEO 3.2.0 RC8