473,411 Members | 1,895 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,411 software developers and data experts.

zero size DIV in IE6

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>
Aug 3 '06 #1
9 1359
Andrew May <an**********@hotmail.comwrote:
>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.
Forms are typically considered as tabular data, using a table to format
a form is considered ok.
>Relevent CSS is:
Please don't post code, post an URL instead.

--
Spartanicus
Aug 3 '06 #2
Spartanicus wrote:
Forms are typically considered as tabular data, using a table to format
a form is considered ok.
It was touch and go which way I went but was influenced by Mark
Newhouse's article at http://alistapart.com/articles/practicalcss. If I
can't get this to work I may return to tables but at the moment I refuse
to be beaten by a Microsoft product.
>
>Relevent CSS is:

Please don't post code, post an URL instead.
Apologies. Full working code is now at:

http://www.girton.ukfsn.org/css/demo.html

with a separate style sheet at:

http://www.girton.ukfsn.org/css/demo.css.

Andrew
Aug 4 '06 #3
Andrew May <an**********@hotmail.comwrote:
>Forms are typically considered as tabular data, using a table to format
a form is considered ok.

It was touch and go which way I went but was influenced by Mark
Newhouse's article at http://alistapart.com/articles/practicalcss. If I
can't get this to work I may return to tables but at the moment I refuse
to be beaten by a Microsoft product.
This isn't a question of practicality, but of principle. If a form is
tabular data then it *should* be marked up using a table. Mark Newhouse
acknowledges this in the cited article:

"Another common use for table layout is lining up FORM elements with
their labels. While it could be argued that this is an appropriate use
of TABLEs, the CSS technique that I describe below will prove to be
useful for other, similar layout needs, as we will see."

So the although technique he demonstrates uses a form, he does not
encourage using it for such.
>http://www.girton.ukfsn.org/css/demo.html
Use a table to markup the form, then use CSS to create the layout
consisting of the navigation and the table holding the form (and only
the form

--
Spartanicus
Aug 4 '06 #4
Spartanicus wrote:
>
Use a table to markup the form, then use CSS to create the layout
consisting of the navigation and the table holding the form (and only
the form
Even if I do recode as tables I would still like to understand what it
is that I am doing wrong that messes up the rendering in IE, or, if the
problem is with IE what I should do to get around it.

Andrew
Aug 4 '06 #5
Andrew May <an**********@hotmail.comwrote:
>Use a table to markup the form, then use CSS to create the layout
consisting of the navigation and the table holding the form (and only
the form

Even if I do recode as tables I would still like to understand what it
is that I am doing wrong that messes up the rendering in IE, or, if the
problem is with IE what I should do to get around it.
The sole intended purpose of the float mechanism is to get inline
content (typically text) to flow around a left or right aligned element.

Sadly many people are abusing floating as a method to create so called
"CSS layouts". Doing so causes problems, some of which can be hacked
around, others cannot.

Read the cited article if you insist on using this flawed approach, I'm
sure it contains a description of the hacks needed to get around the
issue shown.

--
Spartanicus
Aug 4 '06 #6
Spartanicus wrote:
>
The sole intended purpose of the float mechanism is to get inline
content (typically text) to flow around a left or right aligned
element.

Sadly many people are abusing floating as a method to create so
called "CSS layouts". Doing so causes problems, some of which can be
hacked around, others cannot.
Are you arguing that the use of CSS to layout content is A Bad Thing?
--
Jack.
http://www.jackpot.uk.net/
Aug 5 '06 #7
Jack <mr*********@nospam.jackpot.uk.netwrote:
>The sole intended purpose of the float mechanism is to get inline
content (typically text) to flow around a left or right aligned
element.

Sadly many people are abusing floating as a method to create so
called "CSS layouts". Doing so causes problems, some of which can be
hacked around, others cannot.

Are you arguing that the use of CSS to layout content is A Bad Thing?
CSS2 offers no method that was intended, or is suitable to create good
quality www layouts. The various CSS2 methods that are currently used to
try and circumvent this shortcoming all have serious flaws, amongst them
floating is by far the worst.

Comparing the old way of using HTML tables to create a "layout" with the
currently used CSS methods does not result in an overall better or worse
judgement, there is more than one variable to measure such, and varying
priorities.

--
Spartanicus
Aug 5 '06 #8
Spartanicus wrote:
Jack <mr*********@nospam.jackpot.uk.netwrote:
>>The sole intended purpose of the float mechanism is to get inline
content (typically text) to flow around a left or right aligned
element.

Sadly many people are abusing floating as a method to create so
called "CSS layouts". Doing so causes problems, some of which can
be hacked around, others cannot.
Are you arguing that the use of CSS to layout content is A Bad
Thing?

CSS2 offers no method that was intended, or is suitable to create
good quality www layouts. The various CSS2 methods that are currently
used to try and circumvent this shortcoming all have serious flaws,
amongst them floating is by far the worst.
Do you argue, then, that absolute positioning (for example) is less
harmful?
>
Comparing the old way of using HTML tables to create a "layout" with
the currently used CSS methods does not result in an overall better
or worse judgement, there is more than one variable to measure such,
and varying priorities.
I had trouble parsing that. From previous posts, I don't think you mean
to say that CSS and tables are equally preferable as mechanisms for
laying out www pages; but it sounds as if that's what you are saying here.
>
Can you please say whether your opinion is that the use of CSS for page
layout is A Bad Thing?

--
Jack.
http://www.jackpot.uk.net/
Aug 5 '06 #9
Jack <mr*********@nospam.jackpot.uk.netwrote:
>CSS2 offers no method that was intended, or is suitable to create
good quality www layouts. The various CSS2 methods that are currently
used to try and circumvent this shortcoming all have serious flaws,
amongst them floating is by far the worst.

Do you argue, then, that absolute positioning (for example) is less
harmful?
Again: no single qualifier can be attached to the various methods
currently used, they all have their own mix of drawbacks.

A rundown of some of the problems with the currently used methods to
create so called "CSS layouts":

Floated layout boxes
-------------------------------
1) Do not contain their content properly (1).
2) Not in the flow, block level elements adjacent to a float act as if
the layout box isn't there.
3) Floats inside a floated "layout box" influence behaviour of content
in other layout boxes.
4) The content order cannot be changed independently from the position
on screen.
5) Many people struggle to understand the ridiculously complex float
rules and resulting behaviour.
6) As a result of the complex float rules many browsers have float bugs,
the resulting browser inconsistencies cause yet more user frustration.

ABS Positioned layout boxes
-------------------------------------------
1) Do not contain their content properly (a).
2) Not in the flow, footers are impossible.
3) Content in a positioned box cannot be allowed to wrap if there is
another layout box beneath it since it would be clipped, obscure other
content, or generate a scrollbar. The ability for content to wrap is an
essential quality for text content.

CSS Tables
------------------
Short of the semantic issue, CSS tables have all the drawbacks of HTML
tables:
1) Reflows when embedded content loads in table-layout:auto mode.
2) Do not contain their content properly (a) in table-layout:fixed mode.
3) Grid remains rigid regardless of the viewport width (b).
4) The content order cannot be changed independently from the position
on screen.
5) Not supported by IE.

(a) Containing contents, there is no acceptable overflow behaviour:
1) In document scroll bars (usability nightmare).
2) Part of the content is clipped (content partially disappearing is
unacceptable).
2) Part of the content overflows into the adjoining space (thereby often
obscuring other content).

(b) The CSS2 "handheld" media property was ill conceived, it made
unwarranted assumptions about the viewport width on mobile devices, and
fails to cater for a-typical viewport widths on non mobile devices.

--
Spartanicus
Aug 5 '06 #10

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

Similar topics

18
by: Xiangliang Meng | last post by:
Hi. void setValue(int n) { int size = getValueLength(); int buffer_p; if (buffer_p) { ....
53
by: Zhiqiang Ye | last post by:
Hi, All I am reading FAQ of this group. I have a question about this: http://www.eskimo.com/~scs/C-faq/q7.31.html It says: " p = malloc(m * n); memset(p, 0, m * n); The zero fill is...
25
by: prashna | last post by:
Hi all, I have seen a piece of code(while doing code review) which declared an array of size 0.One of my friend told although it is not standard C,some compilers will support this..I am very...
2
by: Mockey Chen | last post by:
I saw some library code wrote like this: struct X{ int x; char y; /* Note: here array size is ZERO, why? */ }; Why use array size zero. I heard about the C standard not allow array...
3
by: Ali Sahin | last post by:
Hi there, I'd like to transform a XML-File to PDF. The XML-File ist build like followed: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <?xml-stylesheet type="text/xsl"...
22
by: semedao | last post by:
Hi , I am using asyc sockets p2p connection between 2 clients. when I debug step by step the both sides , i'ts work ok. when I run it , in somepoint (same location in the code) when I want to...
19
by: nileshsimaria | last post by:
Hi, I have seen some code were we have array with zero elements (mostly within structure) like, typedef struct foo { int data }foo;
64
by: Robert Seacord | last post by:
The C standard doesn't say anything about what happens when you call realloc with a size argument of 0. Both glibc and openbsd appear to return a valid pointer to a zero-sized object.. e.g. the...
1
by: Abdul Samad | last post by:
Assalam mu Alikum, i understand the size of structure with no data types is zero. but why the size of structure variable is 1 Byte when the size of that structure is zeor? for example ...
4
by: Kenneth Brody | last post by:
I looked at my copy of n1124, and I didn't see anything about this particular situation... What happens if you realloc() to a size of zero? Implementations are allowed to return NULL on...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.