|
Posted by Els on 01/14/06 12:52
Jukka K. Korpela wrote:
> Els <els.aNOSPAM@tiscali.nl> wrote:
>
>> If you just enclose your entire page in one div, it might save you
>> some code, depending on how many loose images you have in it.
>
> You save more code by using HTML 4.01 Transitional, which allows "loose"
> content inside body and does not require all end tags.
>
> If you wish to comply with a Strict DOCTYPE, then it's rather pointless to
> use <body><div>...</div></body>, since the _idea_ in Strict is to put text
> and inline markup inside _suitable_ blocks. If you don't care about the idea,
> you could use Transitional, which does not require the pointless
> <div> and </div> tags.
You're probably right about the Strict rules, but I think that having
loose images in a page isn't quite the same as switching to
Transitional altogether.
I always have my pages in a div, simply because I like to have the
option to add a border, a margin. I always have <body><div
id="container">....</div></body>
Often I give that container a left and right margin and a border
colour, or even a shadow effect.
And if I then have some decorative images floated left and right
within the content, I really don't see the problem if there isn't a
<div></div> around them. I think the rule that images and inline
content should be inside suitable blocks, wasn't invented for floating
decorative images, but for semantics. Decorative images aren't
semantic by definition, but because of the <img> element, they are
caught in the rule together with text that should be in paragraphs and
inline images. I prefer to look at the whole of an idea, instead of
scrutinously applying rigid rules without thinking about the reasons
for those rules. Unless there is a compatibility or accessibility
reason for putting decorative images in divs, I don't see the point,
and I find switching to Transitional an over the top measure to allow
loose images. Really, what's worse in your opinion: add a possibly
superfluous div, or change to a doctype that allows a bunch of
deprecated code?
--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
[Back to original message]
|