472,953 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

IE float issue with definition lists

I'm trying to do a two column "form" layout based on article here:

http://www.alistapart.com/stories/practicalcss/

The idea is to have a label, and a value using definition list markup.
I float the dt left, and the dd right with fixed widths for each. This
works fine in both IE and FF until I have a <br> elements within the dd
elements. IE does not clear subsequent dt's, and they are not floated
beneath the multiline dd element, instead they show up directly below
the previous dt.

I'm really trying to avoid a table based approach, but I'm unable to
figure this out. Anyone have an idea as to why the sample below is
rendering like this in IE? Any help is appreciated. Thanks.
<!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" lang="en" xml:lang="en">
<head>
<title>My Page Title</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<style type="text/css">
/* detail view */

.detail_view {
margin: 0;
padding: 0;
}

.detail_view div {
float: left;
padding: 5px;
width: 100%;
margin: 0;
}

.detail_view dl {
margin: 0;
padding: 0;
width: 100%;
clear: both;
float: left;
}

.detail_view dt {
margin: 0;
padding: 0;
float: left;
font-weight: bold;
width: 35%;
clear: both;
display: inline;
}

.detail_view dd {
margin: 0;
padding: 0;
float: right;
width: 65%;
}

.detail_view dd div {
clear: both;
display: block;
background: yellow;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="wrap">
<div id="content">
<div class="gutter">
<form method="post" action="#">
<div class="detail_view">
<dl>
<dt>Address:</dt><dd><div>IE won't clear birthday
label<br/>float</br>properly!</div></dd>
<dt>Birthday:</dt><dd>Mar. 2, 2000</dd>
<dt>Sex:</dt><dd>Male</dd>
<dt>Social Security:</dt><dd>123-45-6789</dd>
</dl>
</div>
</form>
</div>
</div>
</body>
</html>

Apr 18 '06 #1
2 2407
jim
This works in msie & ffox; eliminates the dd's and the dt's too ;-)
Looks like you need a 2-column form holder so I tried to set it up in
that
way for you to easily adapt it to your needs.

Note that the width of the holder div and the set widths of the 'label'
and 'value'
div classes are what keeps everything lined up. if you need to
increase the width values,
then you should proportionately increase them all. -Jim

------------------------------------------------------------------------------------------------------------------------
<!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> 2-column layout
</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<meta name="language" content="en-us">
<style type="text/css">
..label {
display:inline;
float:left;
width:150px;
height:22px;
font-size:9pt;
text-align:right;
}

..value {
display:inline;
float:left;
width:150px;
height:22px;
font-size:9pt;
text-align:left;
margin-left:25px;
}
#holder {
position:absolute;
left:25px;
top:25px;
width: 400px;
}
</style>
</head>
<body >
<div id="holder">
<div style="background-color:black; color:white; font-family:arial;
font-size:12pt; text-align:center; border-bottom:4px

gray double; margin-bottom:5px; ">2-Column Form Holder</div>

<form name="myform" method="post" action="">
<div class="label"> Name:</div>
<div class="value"> <input type="text size="32"/> </div>

<div class="label"> Origin:</div>
<div class="value"> <input type="text size="32"/></div>

<div class="label"> Email:</div>
<div class="value"> <input type="text size="32"/></div>

<div class="label"> Occupation:</div>
<div class="value"> <input type="text size="32"/></div>

<div class="label"> Favorite Food:</div>
<div class="value"> <input type="text size="32"/></div>

<div class="label"> Fav Music:</div>
<div class="value"> <input type="text size="32"/></div>

<div class="label"><input type="submit" value="Submit"/></div>
<div class="value"><input type="reset" value="Reset"/>

</form>
</div>
</body>

Apr 18 '06 #2
kr*****@gmail.com wrote:

I'm really trying to avoid a table based approach, but I'm unable to
figure this out.

<dt>Birthday:</dt><dd>Mar. 2, 2000</dd>
<dt>Sex:</dt><dd>Male</dd>
etc.


This is tabular data. Use a table.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Apr 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Dave H | last post by:
Hello, I have a query regarding definition lists. Is it good practice semantically to use the dt and dd elements to mark up questions and answers in a frequently asked questions list, or FAQ? ...
0
by: edgard | last post by:
Hi! IE6 has a bug while printing floating tags. I solved some of them positioning elements as relative. But I've got the trouble with definition lists. Floating to left the definition term...
7
by: Neil Zanella | last post by:
Hello, I have posted the following message before but got no replies... I am trying to format an HTML definition list with CSS so that it appears as follows, but am having the following problem:...
0
by: Jimmy Cerra | last post by:
I recently came up with a cool little stylesheet for definition lists. There is a small demostration for the impatient . I hope this helps someone. Here's how I did it. Definition lists are...
26
by: Alexander Block | last post by:
Hello newsgroup, let's say I have a function like template<class Type> inline bool areEqual(const Type &a, const Type &b) { return ( a == b ); }
13
by: maadhuu | last post by:
hello , i would like to know as to why double is more efficient than float . thanking you, ranjan.
2
by: Ian N | last post by:
Hi, I've been trying to get my CSS menu to float to the middle of the page. As i'm also designing to cater for users with 800 x 600 browsers, i have split the menu into two lists, this way it'll...
3
by: Arnie | last post by:
Folks, We ran into a pretty significant performance penalty when casting floats. We've identified a code workaround that we wanted to pass along but also was wondering if others had experience...
15
by: akomiakov | last post by:
Is there a technical reason why one can't initialize a cost static non- integral data member in a class?
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.