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

Stylesheet vs. HTML tags

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
Jul 20 '05 #1
5 1940
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.
(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).
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
Jul 20 '05 #2
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.
(things such as widths/heights
Is it content? Image height is best done in HTML, as this is a
content issue, and helps browsers render the document quicker. Is it
to define the width of a paragraph or the margins of a page? That is
presentation, and belongs in css.
background colors and images, etc.)
Background stuff is presentation. Use css.
I can see where either or would have benefits depending on how you
wanted to manipulate it,
I don't see why that would be relevant, except as a content v.
presentation consideration.
but I can see in some cases where it wouldn't seem to matter which
context you defined it
Such as?
and I was wondering if it was recommended or preferred to use one
or the other or perhaps both?


Css is optional. Browsers don't need to consider it. As long as you
don't mistake form for content -- e.g., you may want headings in dark
green and paragraphs centered, but you don't *need* them -- then
perhaps this fact will help you decide.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #3
Brian wrote:
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

Jul 20 '05 #4
In article <5f**************************@posting.google.com > in
comp.infosystems.www.authoring.stylesheets, Catherine Lynn Smith
<kl*****@hotmail.com> 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.


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/
Jul 20 '05 #5

"Catherine Lynn Smith" <kl*****@hotmail.com> wrote in message
news:5f**************************@posting.google.c om...
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.
Jul 20 '05 #6

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

Similar topics

4
by: Catherine Lynn Smith | last post by:
OK, I am learning my way around the new DOM, but I am still at a loss on finding a few things. I have an HTML document that links to a stylesheet. /* START STYLESHEET EXAMPLE */ /*...
4
by: Catherine Lynn Smith | last post by:
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...
17
by: Bruce W...1 | last post by:
I don't seem to be getting anywhere with trying to make my web page transitional XHTML. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
2
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/authoring-faq Posting-Frequency: twice a week (Mondays and Thursdays) Last-modified: August 28, 2002 Version: 1.15 URL: http://css.nu/faq/ciwas-aFAQ.html...
0
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/authoring-faq Posting-Frequency: twice a week (Mondays and Thursdays) Last-modified: April 10, 2003 Version: 1.16 URL: http://css.nu/faq/ciwas-aFAQ.html Maintainer:...
8
by: raykyoto | last post by:
Hi all, I must be re-inventing the wheel, but I can't seem to find a stylesheet for bibliographies. I'm probably inputting the wrong keywords into Google... Well, I gave up searching and since...
3
by: Ron Vecchi | last post by:
I'm pretty new to Xml and Xslt so bear with. I cant seem to add the xsl prefix to my stylesheet and get it to work. Error: The wrong namespace was used for XSL. Use...
3
by: Random | last post by:
Under .NET, why doesn't the "class" attribute seem to apply to elements that refer to a specific stylesheet reference? I've verified that the stylesheet is being referenced by creating styles that...
8
by: WebBuilder451 | last post by:
i'm sending email via an aspx page. The format is html. Is there a way to include a link to a stylesheet? I notice that the Dim mail As New MailMessage mail.Body = msg mail.BodyFormat =...
0
by: Robert | last post by:
Hi all, I've got a stylesheet defining 3-column layout using CSS stylesheet. I used to define this stylesheet this way: <link href="Whatever/Style.css" rel="stylesheet" type="text/css" /> and in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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.