473,386 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Floated class content will not stay in in Div

I've got a page where I'm replacing the tables by using nested div tags and float. The vertical size of the div is not changing to hold all the content. I got it to work in IE but in foxfire I have to add the height element to the div to see any content. I've tried to set the margin, padding, and border to get around the problems of margin-collapsing with no luck. Any ideas would be helpfull.

Thanks

Here is the html
<div id="valistheader">
<span class="valistheadername"><b>Course Name</b></span>
<span class="valistheadernote"><b>Course Note</b></span>
<span class="valistheaderdate"><b>Date</b></span>
<span class="valistheaderbutton">&nbsp;</span>
<span class="valistheaderbutton">&nbsp;</span>
</div>

This is the css
#valistheader {clear:both;display:block; padding: 2px 0px 2px 0px;background: #003366;border-bottom: 1px solid #FF6600;text-align:left;color:#ffffff;}
.valistheadername {float:left;width: 40%;}
.valistheadernote {float:left;width: 40%;}
.valistheaderdate {float:left;width: 10%;}
.valistheaderbutton {float:left;width: 5%; }
Jan 4 '07 #1
1 1628
drhowarddrfine
7,435 Expert 4TB
Firefox is performing correctly. What you are seeing in IE is a bug. Divs are NOT to contain floated or absolutely positioned elements.

To get modern browsers to do what IEs bug is doing, google for "clear floats". You can try adding overflow:auto; to the parent div and see if it does the job for you.
Jan 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ney André de Mello Zunino | last post by:
Hello. The issue is quite known: you have a block-level container holding a set of floated elements and you need that the container's content height take the floated elements' dimensions into...
0
by: Mike Kozlowski | last post by:
I have a div floated left for a navbar, with another div in the normal flow for content, like so: #leftnav { float: left; width: 120px; } #content { margin-left: 170px; margin-right: 10px;} ...
24
by: Thomas Mlynarczyk | last post by:
Hi, Here's what I have: <div> <img ...><br> Caption text </div> The div is floated left and has no width set, the content is centered, there are no margins or padding on the <img> (just a...
4
by: Matt | last post by:
Hi, Got an unordered list with 100% width, with 5 list items of 20% width styled to fill the width of the container element. Renders fine in Mozilla, but when you change the size of the window...
9
by: edski | last post by:
Using a technique I found here: http://www.vertexwerks.com/tests/sidebox/ I created these "dialogue" boxes: http://www.ebph.org/test.htm In IE6, the text does not wrap correctly around the...
1
by: alex | last post by:
Hey all, May have missed this in the FAQ, advice or article links welcome. Have a content div with a navigation div floated left and an advertisement div floated right. I would like to have a...
4
bugboy
by: bugboy | last post by:
Hi! I have multiple floating boxes inside a main box that has a fixed dimension. The floating boxes may vary in number and i want them to stay lined up along the top of the main box with a...
0
by: clumsy_ninja | last post by:
I'm trying to create a tableless layout for a form. The following markup works as intended in Firefox and Opera, but one of IE 7's bugs ends up misplacing the floated input fields side-by-side even...
7
by: Ed Jay | last post by:
I have two divs. The left div is floated left and the right div is floated right. If the left div contains a single line, the left and right divs are on the same line (obviously). But...the left...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.