PDA

View Full Version : silly question


dantra
04-20-2006, 08:27 PM
I apologize for this stupid question in advance, but I can't find the answer on line.

How can this line validate:
<td vAlign="top" width="191">

I know that vAlign="top" doesn't belong there ... I mean it works, but won't validate.

abrewitt
04-20-2006, 08:45 PM
Just wondering why you are not using css for the alignment and width?

td{width: 191px; padding-top: 0;} - something like that!

as for validation I dont think either of those parameters belong in their.

that may have helped, Anthony:)

orcrist
04-20-2006, 08:59 PM
valign must go in css, as vertical-align. better yet, as abrewitt said, move all presentational code there, all widths, heights, colors, borders, etc.
and all in lowercase, but i belive it was a typo

dantra
04-20-2006, 09:01 PM
thanks guys... I got it now. It worked out great.

VIPStephan
04-20-2006, 09:03 PM
At first: Please choose more descriptive titles for your posts. (you haven't read the forum rules, have you?)
Secondly: Keep your code lower case. Makes future maintenance and possible transition to XHTML easier.
And finally: For styling your content you can, as abrewitt already mentioned, use CSS. There is even a vertical-align property which works on table cells. But the default alignment is top anyway, so you might just need it to revert a different alignment from before.

dantra
04-20-2006, 09:14 PM
You guys are extremely helpful here and I really appreciate it. thanks for the sound advice, it's the little things that makes a difference.
So if I want the page to align to the top it aligns itself by default to the top,
- of course if I want or need a margin I just add that in my stylesheet -

VIPStephan
04-20-2006, 09:39 PM
Note that there is a default margin and/or padding on the body so if you want the page stick to the very top of the window ste the default to zero in the CSS:

body {
margin: 0;
padding: 0;
}

I set padding too because you never know...

Also Firefox will push the whole content down if you have a top margin and no other element is closed before.

<body>
<div id="container">
<h1>title</h1>
...

The <h1> for example has a default margin and will push the whole content down. Setting it to zero (or not applying any top margin to the topmost element) will fix that. I had a hard time finding that out but once you know you'll laugh about it. :)

Just for your information, cause
[...] it's the little things that makes a difference.;)