I need some help please. I am new to CSS and am trying to convert an
Intranet based database front-end from a table-based layout to use CSS.
Each page is basically a form using a two-column format with a
navigation bar on the left. In order to layout the form I am using a div
for each form element that in turn contains two spans, one for the label
and on for the actual form control floated left and right respectively.
All seems to work as expected in Opera and Firefox but Internet Explorer
(version 6.0 sp2) insists on creating zero size form-element DIVs which
results in the Sub Form Heading overlapping. I added the
background-color to the form-element DIV so that I could see at what
size it was rendered.
I’m new to CSS so am probably missing something obvious. Any pointer
would be much appreciated.
Many thanks,
Andrew
Relevent CSS is:
div.form-element
{
overflow: auto;
background-color: #f0f0f0;
}
div.form-element span.form-label
{
float: left;
width: 120px;
text-align: right;
font-weight: bold;
}
div.form-element span.form-item
{
float: right;
text-align: left;
width: 360px;
}
The HTML is:
<div id="page">
<div id=”navigation”>
Navigation text
</div>
<div id="main">
<div class="form">
<h1>Form Heading</h1>
<form method="POST" name="form">
<div class="form-element">
<span class="form-label">Group Name:</span>
<span class="form-item"><input type="text" name="Name"></span>
</div>