PDA

Click to See Complete Forum and Search --> : (CSS) TR/TD and height attribute


msimmons
Jun 24th, 2002, 02:42 PM
I know you cannot do this

<tr height="5">

but it looks like you can do this

<tr style="height:5px">


is that correct?
Michael

cpradio
Jun 24th, 2002, 03:19 PM
Using CSS is legal, but its normally best to either assign it a class or id.

msimmons
Jun 24th, 2002, 03:21 PM
yes, I just did it quickly for sake of post.
Thanks,
Michael

cpradio
Jun 24th, 2002, 03:22 PM
if you use CSS correctly you can just about get around every HTML 4.0 and XHTML 1.0 standard.

CiberTHuG
Jun 25th, 2002, 09:46 AM
Originally posted by cpradio
if you use CSS correctly you can just about get around every HTML 4.0 and XHTML 1.0 standard.

Get around?

cpradio
Jun 25th, 2002, 09:56 AM
yeah, "get around".

HTML 4.0 and XHTML 1.0 tell you, you are not allowed to put width="5px" or height="15px" in your <td>, <tr>, and many other tags. Therefore if you use style="width:5px;height:15px" you have just opened a loop whole of including such attributes.

-Matt

CiberTHuG
Jun 25th, 2002, 10:23 AM
Ah. I see the confusion.

Uhm... it's not a loophole. These attributes have been deprecated in favor of CSS.

In other words, the HTML standard says don't use width="5px", because you should use inline style or CSS.

Loophole implies that the standard doesn't want you to set layout at all. The standard does, just not with the old, pre-CSS methods.

cpradio
Jun 25th, 2002, 10:40 AM
I know its not a loop hole, I was just using that as a description. I find CSS to be a real pain when using it to define width and height attributes as each browser interprets it differently thus throwing any borders or colors out of alignment with other divs.

Its a real pain in the butt and untill css is more standardized I will be using the width attributes in <td> tags as that is legal.

cpradio
Jun 25th, 2002, 10:46 AM
I know its not a loop hole, I was just using that as a description. I find CSS to be a real pain when using it to define width and height attributes as each browser interprets it differently thus throwing any borders or colors out of alignment with other divs.

Its a real pain in the butt and untill css is more standardized I will be using the width attributes in <td> tags as that is legal.

JoshT
Jun 25th, 2002, 11:04 AM
Originally posted by cpradio
I know its not a loop hole, I was just using that as a description. I find CSS to be a real pain when using it to define width and height attributes as each browser interprets it differently thus throwing any borders or colors out of alignment with other divs.

Its a real pain in the butt and untill css is more standardized I will be using the width attributes in <td> tags as that is legal.

CSS has been standardized for years - it's just that there's a certain evil browser that's quite popular that doesn't correctly interpret the height and width tags until version 6 for its maker's OS, and then only if you specifically tell it to be standard compliant thru the doctype tag...

CSS3 is going to have columns, BTW...

CiberTHuG
Jun 25th, 2002, 11:09 AM
Originally posted by cpradio
I will be using the width attributes in <td> tags as that is legal.

That is fair. But you will have to rewrite your pages once browsers stop supporting the deprecated attributes. Nothing is wrong with that. Just a different way of doing things.

In the meantime, you could avoid deprecated conventions, and help fix the browser market by forcing users to be more selective in their choice, and thus forcing the browser makers to be more aware of the standards.

After all, this isn't cutting edge. These standards have been in place for what... four years?

CiberTHuG
Jun 25th, 2002, 11:12 AM
Wait, never mind what I said about rewriting. A page that uses the correct doctype should always be rendered the same way because it is a version X page. Even after X + n is released, any backwards compatible browser should still be able to render your version X page in the manner you intended.

The stuff about driving the market still holds, though.

cpradio
Jun 25th, 2002, 12:05 PM
I truely disbelieve that CSS is standardized. I consider standard meaning it will display the same result in any browser you view your page in.

My CSS and PHP pages are valid CSS 2 and XHTML 1.0 code (I have tested them). Now originally I was using <div> tags to display the particular style attributes needed for the design. I had the width and height attributes as absolute values yet the borders on higher divs did not match those below, but both had a width of 690px! How is that possible, and how can you call that standardized? (And to make it worse W3C's browser, Amaya, place a linebreak after each <div>:mad:)

Secondly, I hear using External style sheets is better than embedding it into your code. I tried this method only to find out that Opera and Netscape 4.7 would not render my site correctly if I used the <link href="" blah blah> method or the <style type="text/css"> @import url("style.css"); </style> method. Why does that happen??

Honestly, I have been working with CSS for the past two weeks straight. I still ahve 35% more backend to do before I can release my project, but I can show you the design (except in <div> tags, i kinda deleted that).

To show you how much trouble I have had with this CSS junk that is supposedly standardized between browsers you can review these threads:
http://www.webxpertz.net/forums/showthread.php3?s=&threadid=17282
http://www.webxpertz.net/forums/showthread.php3?s=&threadid=17299

The site I am working on is at http://cpradio.net/advBlogger/ and its only a design right now, atleast until I complete the backend.

-Matt

JoshT
Jun 25th, 2002, 02:04 PM
I truely disbelieve that CSS is standardized. I consider standard meaning it will display the same result in any browser you view your page in.

No, because standards have to be agreed upon and formally written down before browser makers can make their browsers render to the standard, so browsers will always be behind the latest standards.

Secondly, I hear using External style sheets is better than embedding it into your code. I tried this method only to find out that Opera and Netscape 4.7 would not render my site correctly if I used the <link href="" blah blah> method or the <style type="text/css"> @import url("style.css"); </style> method. Why does that happen??

The @import is actually used as a hack to prevent legacy browsers from attempting to use the CSS.


Another thing to take into consideration - correct use of HTML/CSS means that if you totally strip all CSS out of your document it will still be usable and make sense.

Also, the total displayed width of a block is not the CSS width attribute, but margin-left + border-left + padding-left + width + padding-right + border-right + margin-right.

cpradio
Jun 25th, 2002, 02:07 PM
yeah, I know padding and stuff also is in it and all of those were set to 2px so that should not have made a difference.

My site depends on CSS as it follows the standards knowing bgcolor is deprecated

CiberTHuG
Jun 26th, 2002, 09:00 AM
Originally posted by JoshT
No, because standards have to be agreed upon and formally written down before browser makers can make their browsers render to the standard, so browsers will always be behind the latest standards.


Yeah, it just sucks that browsers are four years behind.