473,406 Members | 2,387 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,406 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 2426
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.