HighDots Forums  

Stylesheet vs. HTML tags

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Stylesheet vs. HTML tags in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Stylesheet vs. HTML tags - 09-22-2003 , 08:39 AM






I notice as I delve deeper into CSS that many property definitions are
redundant between the HTML tags and the CSS properties. I was
wondering if there was a recommended preference as to which to use.
(things such as widths/heights, background colors and images, etc.)

I can see where either or would have benefits depending on how you
wanted to manipulate it, but I can see in some cases where it wouldn't
seem to matter which context you defined it and I was wondering if it
was recommended or preferred to use one or the other or perhaps both?

KL

Reply With Quote
  #2  
Old   
Philipp Lenssen
 
Posts: n/a

Default Re: Stylesheet vs. HTML tags - 09-22-2003 , 09:13 AM






Catherine Lynn Smith wrote:

Quote:
I notice as I delve deeper into CSS that many property definitions are
redundant between the HTML tags and the CSS properties. I was
wondering if there was a recommended preference as to which to use.
(things such as widths/heights, background colors and images, etc.)

Ideally, CSS can completely replace layout-HTML3.2, and if possible in
your target-browser, that's always the better way. (If you know why you
are using CSS, then you should also know why this is better.)
Some things cannot be implemented in CSS for certain browsers, and
HTML-workarounds might be your choice (depending how much you/ your
customer cares about certain layout details -- like, getting rid of a
border around a linked image in Netscape 4 via CSS can be tough, and
you might want to have a more relaxed doctype to support a hack --
personally I don't care about Netscape 4 and don't use workarounds on
private pages, but many clients will care).

Quote:
I can see where either or would have benefits depending on how you
wanted to manipulate it
So where do you see benefits in HTML tags that could be implemented as
CSS? Mostly, they will make the site slower to manage.

By the way, if you are just using inline-styles like <p
style="...">...</p> indeed you might as well stick to "HTML tags" for
layout-definiton.

--
Google Blogoscoped
http://blog.outer-court.com


Reply With Quote
  #3  
Old   
Matthias Gutfeldt
 
Posts: n/a

Default Re: Stylesheet vs. HTML tags - 09-22-2003 , 10:20 AM



Brian wrote:
Quote:
If you feel you absolutely *must* x-post, please set followups.
(set to ciwas)

Catherine Lynn Smith wrote:

I notice as I delve deeper into CSS that many property definitions
are redundant between the HTML tags and the CSS properties. I was
wondering if there was a recommended preference as to which to use.

Content can only be done with html. Presentation is best done with css.
Unfortunately (or not) CSS does have a couple properties for content,
see <http://www.w3.org/TR/CSS2/generate.html>, and of course there are
designers that will use these properties to the fullest extent. Which is
fine for experimental pages, of course.


Matthias



Reply With Quote
  #4  
Old   
Stan Brown
 
Posts: n/a

Default Re: Stylesheet vs. HTML tags - 09-22-2003 , 01:38 PM



In article <5fb632c2.0309220539.3441d7ed (AT) posting (DOT) google.com> in
comp.infosystems.www.authoring.stylesheets, Catherine Lynn Smith
<klynntg (AT) hotmail (DOT) com> wrote:
Quote:
I notice as I delve deeper into CSS that many property definitions are
redundant between the HTML tags and the CSS properties. I was
wondering if there was a recommended preference as to which to use.
Presentational aspects of HTML are deprecated.[1] To deprecate means
"to attempt to ward off by prayer".

Translation: When you have a CSS way available, it's better to use
that than the HTML way for things like fonts, margins, colors, etc.

This is not some airy-fairy abstract "better because it's in the
standard". You the author get a solid benefit: you can set styles
_once_, in a linked stylesheet, rather than have to set them on
every single element. That means that when you want to change some
aspect of your design (NB when, not if), you can change it once
instead of having to edit all of your HTML pages.

[1] http://www.w3.org/TR/html401/appendi...html#h-A.3.1.2
and http://www.w3.org/TR/html401/appendi...s.html#h-A.3.2

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/


Reply With Quote
  #5  
Old   
C A Upsdell
 
Posts: n/a

Default Re: Stylesheet vs. HTML tags - 09-23-2003 , 09:57 AM




"Catherine Lynn Smith" <klynntg (AT) hotmail (DOT) com> wrote

Quote:
I notice as I delve deeper into CSS that many property definitions are
redundant between the HTML tags and the CSS properties. I was
wondering if there was a recommended preference as to which to use.
(things such as widths/heights, background colors and images, etc.)
Use CSS for control of how content should be presented. Add minimal HTML
needed by legacy browsers (mainly NN4) for acceptable presentation.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.