[SOLVED] DIVs and Firefox - help!

This is a discussion on "[SOLVED] DIVs and Firefox - help!" within the Web Page Design section. This forum, and the thread "[SOLVED] DIVs and Firefox - help! are both part of the Design Your Website category.



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

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 4th, 2007, 09:57
Emzi's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Manchester
Age: 25
Posts: 148
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] DIVs and Firefox - help!

Hiya all.

I'm setting up a dummy website at the moment and I have 2 DIVs with a main DIV.

The main DIV I want to have a border and background colour that stays in effect with the 2 DIVS within it. (Basically to have the page with a nice border around it and background colour etc.)

This works fine in IE, but in FireFox it doesn't want to know. The main DIV seems only to want to be 150px in height and doesn't fill the whole page like it does in IE. I've tried adding the style height: 100% and other various variables but it doesn't seem to work.

I don't want to have to use a table to do this

Anyone know what I can do??

Code is this if it helps:

HTML: Select all
<div style="width:750px; margin:auto; border: 1px solid #000000; background-color: #0033FF;">
 
<div style="width:auto;margin:10px;">
 
<div>
CONTENT HERE
</div>
 
</div>
 
</div>

Last edited by karinne; Oct 4th, 2007 at 11:51. Reason: Changed to [ html ] vBcode

  #2 (permalink)  
Old Oct 4th, 2007, 10:01
welshstew's Avatar
Lead Administrator

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,388
Blog Entries: 13
Thanks: 1
Thanked 17 Times in 15 Posts
Re: DIVs and Firefox - help!

Hiya emzi,

First check the stickies at the top of this css forum for excellent resources and tutorials

These will go a long way to building your knowledge.

I'll have a look at your specific code in a mo for you.
__________________
WelshStew
Lead Administrator

tierney rides tboard - uk site | xtreme wales - extreme clothing
If you think I've helped, click the "Thanks"
webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
  #3 (permalink)  
Old Oct 4th, 2007, 10:10
welshstew's Avatar
Lead Administrator

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,388
Blog Entries: 13
Thanks: 1
Thanked 17 Times in 15 Posts
Re: DIVs and Firefox - help!

Is this the type of thing you were after
HTML: Select all
<!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>
<title>emzi 2 column layout</title>
<style type="text/css">
body {
font-size:12px;
font-family:Arial;
color: black;
background-color: blue;
text-align: center; /* centering the content for IE6 */
}
#wrapper {
display:table; /* must put this in for FireFox. */
width:650px;
margin:auto; /* for IE6 and Firfox centering */
text-align:left; /* so that IE6 and Firefox puts the text to the left
*/
border:1px solid red;
background-color: white;
height:400px; /* Have to put somehting in here for the height for both
browser. DO NOT put in a percentage, must be a pixel value */
}

#sidebar {
float:left; /* float the menu to the left */
width:150px;
background-color:#e6e6cc;
border:1px solid red;
height:100%; /* so the menu has the height of the main content and
visa versa */
}

#main {
float:right; /* float the content to the right */
width:490px;
border:1px solid green;
height:100%;/* so the content has the height of the menu and visa
versa */
}
</style>
</head>
<body>
<div id="wrapper">
<div id="sidebar">
<h2>Menu</h2>
<p>test</p>
<p>test</p>
<p>test</p>
</div>
<div id="main">
<h2>Main Content</h2>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
</div>
</div>
</body>
</html>
__________________
WelshStew
Lead Administrator

tierney rides tboard - uk site | xtreme wales - extreme clothing
If you think I've helped, click the "Thanks"
webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)

Last edited by karinne; Oct 4th, 2007 at 11:51. Reason: Changed to [ html ] vBcode
  #4 (permalink)  
Old Oct 4th, 2007, 10:15
Emzi's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Manchester
Age: 25
Posts: 148
Thanks: 0
Thanked 0 Times in 0 Posts
Re: DIVs and Firefox - help!

Wow thanks for that. You went to alot of trouble to do that and I appreciate it I looked at your code and the thing that I needed was the 'display: table' attribute, and now it works fine!

Thanks alot for your help, it's much appreciated
  #5 (permalink)  
Old Oct 4th, 2007, 10:42
welshstew's Avatar
Lead Administrator

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,388
Blog Entries: 13
Thanks: 1
Thanked 17 Times in 15 Posts
Re: DIVs and Firefox - help!

cool, apologies for the overkill, wa a bit confused by your "two divs in one div" but glad you got it sorted
__________________
WelshStew
Lead Administrator

tierney rides tboard - uk site | xtreme wales - extreme clothing
If you think I've helped, click the "Thanks"
webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
Closed Thread

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
[SOLVED] how to put divs next to each other lostboys Web Page Design 9 Jan 13th, 2008 20:47
Divs in IE and Firefox Slimane Web Page Design 6 Sep 24th, 2007 14:07
IE 7 vs Firefox & extra space between divs Kurt Web Page Design 4 Sep 20th, 2007 21:26
Problem with Firefox divs... WillRevera Web Page Design 3 Aug 31st, 2007 16:29
Floated Divs dont expand centered div in firefox mikka23 Web Page Design 7 Jan 1st, 2007 01:17


All times are GMT. The time now is 16:32.


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