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

divs And spans in Standards Mode - Tell Me it Ain't So...

Hi All,

I built a great looking page to learn CSS, using div's for 'rows' and
span's for 'columns' - nice complex layout where I could create just
about anything by endlessly nesting them as required, and all without
tables to boot.

You can probably guess the rest - ran it in standards mode and it looks
like cr*p... The span's width style attributes seem to be ignored and
everything just reverts to one long column. Tried changing span's to
div's w/display:inline, but same result.

I assume that quirks mode allows this type of layout, where standards
mode doesn't - what exactly was the quirk? Am I missing something
obvious? Is this why both my evangelical CSS books bust out the table
tags on anything non-trivial? Is it possible to create vertically
flowing but horizontally fixed layouts without resorting to tables?

TIA,
David M

Jul 21 '05 #1
5 1553

<da************@yahoo.com> wrote:
Hi All,

I built a great looking page to learn CSS, using div's for 'rows' and
span's for 'columns' - nice complex layout where I could create just
about anything by endlessly nesting them as required, and all without
tables to boot.
This is your first mistake - you still think with tables, but use <div />
instead of <td />
Read about html document semantic.
You can probably guess the rest - ran it in standards mode and it looks
like cr*p... The span's width style attributes seem to be ignored and
everything just reverts to one long column. Tried changing span's to
div's w/display:inline, but same result.
I assume that quirks mode allows this type of layout, where standards
mode doesn't - what exactly was the quirk? Am I missing something
obvious?
Yes, you are.
http://www.w3.org/TR/CSS21/visudet.html#q4
http://www.w3.org/TR/CSS21/visudet.h...e-non-replaced
Is this why both my evangelical CSS books bust out the table
tags on anything non-trivial? Is it possible to create vertically
flowing but horizontally fixed layouts without resorting to tables?


It is possible, there are loads of tutorials, articles and examplesaround
the web.
you can start here:
http://css-discuss.incutio.com/?page=CssLayouts


Jul 21 '05 #2
Dave,
There is nothing wrong with tables when one is trying to present a matrix of
data that are most meaningfully presented in grid format. Do not confuse
matrix layout with page layout.
Timo

"Pawel Knapik" <pa**********@gmail.com> wrote in message
news:d0**********@achot.icm.edu.pl...

<da************@yahoo.com> wrote:
Hi All,

I built a great looking page to learn CSS, using div's for 'rows' and
span's for 'columns' - nice complex layout where I could create just
about anything by endlessly nesting them as required, and all without
tables to boot.


This is your first mistake - you still think with tables, but use <div />
instead of <td />
Read about html document semantic.
You can probably guess the rest - ran it in standards mode and it looks
like cr*p... The span's width style attributes seem to be ignored and
everything just reverts to one long column. Tried changing span's to
div's w/display:inline, but same result.
I assume that quirks mode allows this type of layout, where standards
mode doesn't - what exactly was the quirk? Am I missing something
obvious?


Yes, you are.
http://www.w3.org/TR/CSS21/visudet.html#q4
http://www.w3.org/TR/CSS21/visudet.h...e-non-replaced
Is this why both my evangelical CSS books bust out the table
tags on anything non-trivial? Is it possible to create vertically
flowing but horizontally fixed layouts without resorting to tables?


It is possible, there are loads of tutorials, articles and examplesaround
the web.
you can start here:
http://css-discuss.incutio.com/?page=CssLayouts

Jul 21 '05 #3
"" wrote in comp.infosystems.www.authoring.stylesheets:
You can probably guess the rest - ran it in standards mode and it looks
like cr*p... The span's width style attributes seem to be ignored


"This property does not apply to non-replaced inline-level
elements."[1] (Basically IMG and OBJECT are replaced elements, and
the other inline elements like SPAN are non-replaced.)

[1] http://www.w3.org/TR/CSS21/visudet.html#propdef-width

--

Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
Jul 21 '05 #4
> The span's width style attributes seem to be ignored

Yes, you can't have a width on a span. I don't know why.
display:inline-block is probably the "right" way around this, but it
isn't widely supported.

--Phil.

Jul 21 '05 #5
"" wrote in comp.infosystems.www.authoring.stylesheets:
The span's width style attributes seem to be ignored


Yes, you can't have a width on a span. I don't know why.
display:inline-block is probably the "right" way around this, but it
isn't widely supported.


"What's this about attributing properly?"
http://www.xs4all.nl/%7ewijnands/nnq/nquote.html#Q6

Rather than inline-block, I would think a series of floats would
make the most sense, particularly if they're all supposed to have
the same width.

But, as someone else noted, if the data are being presented in
columns because the items have logical relation to each other, then
<table> markup would seem entirely appropriate.

One of the shibboleths in CSS seems to be that one _must_ replace
tables with CSS. While that's usually true when tables are used
strictly for layout,(*) it's false when a table shows relationships
between columns or rows or both.

(*) I feel guilty that my own site map is table based, and so are
many tables of contents on my pages. I'm going to fix that Real
Soon Now.

--

Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
Jul 21 '05 #6

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

Similar topics

2
by: AGChandler | last post by:
Hi, I have a div (class = "brands") containing other divs, each of which contains an image. I'm trying to set padding around the images, and my style seems to work okay on all but Explorer (I'm...
30
by: Adam Siler | last post by:
i want to display a series of inline, fixed-width DIVs that will wrap into columns - a table, basically. i can do it under Internet Explorer, but the same code under Netscape or Opera does not...
6
by: Ivo | last post by:
Hello, I have some pages which are close to pixel perfect in Win/IE6 in quircks mode with text-size set to "smaller", but not at all on other systems. In Mozilla clicking a link scrolls the page...
1
by: Siegfried Heintze | last post by:
I want to implement drag and drop for tables, divs, spans. The problem is that I don't know how wide or long my tables, divs and spans are going to be in advance so I cannot use absolute...
15
by: Zhang Weiwu | last post by:
http://www.w3.org/MarkUp/2004/xhtml-faq provided a trick to serve xhtml webpage to IE as application/xml I used that trick and now every one of my xhtml webpage have following first 4 starting...
4
by: jwwest | last post by:
Hello all, I've been building a simple site based on XML, XSL and CSS in order to help me learn those technologies better. However, building a tableless page is brand new to me so I've run into...
14
by: Bouzy | last post by:
This is a question that i am sure some of you can answer quickly, but anway. I have been learning how to code useing Xhtml and CSS. I am confused about some CSS properties. I know classes and ids...
7
by: maya | last post by:
hi, I got this unusual design (well, not so unusual anymore, I guess..) for an input text field for a search form in top of page.. http://www.mayacove.com/design/search/search.html I can't...
6
by: Liam Gibbs | last post by:
Hello everyone, I'm trying to program a church web site and I'm having a number of problems with the layout. The html is at http://www.altmarvel.net/Liam/index.html and the css is at...
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?
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
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
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...
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...

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.