navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

CSS vs. HTML

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> CSS vs. HTML
Page: [1]
 
BeTheBall

 

Posts: 6359
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
CSS vs. HTML - 6/22/2006 11:21:58   
Should one use CSS for all formating? For example, if I have one word in a sentence that I want to be bold, should I put it in <span> with a class or is it still acceptable to use <strong> tags? Or centering a paragraph, should I use a class or is the align attribute acceptable?

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
markhawker

 

Posts: 511
Joined: 5/31/2004
From: Leeds, UK
Status: offline

 
RE: CSS vs. HTML - 6/22/2006 11:26:05   
I think it depends on the coder, personally I'd put it in a CSS. What if instead of having a highlighted item bold I also wanted it to be red? You'd have to add and update each element seperately. If you didn't actually want your text to be centred you'd have to modify this in the code of each page rather than in one CSS. Unless it's damned cellspacing in IE!!!

_____________________________

Mark Hawker
my business - http://www.thebubblejungle.com/
facebook - http://www.thebubblejungle.com/facebook/
web hosting - http://www.crucialp.com/

(in reply to BeTheBall)
Tailslide

 

Posts: 6040
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: CSS vs. HTML - 6/22/2006 11:35:16   
I use strong tags - they have a semantic meaning which goes beyond styling and which you'd want a screen reader to pick up on whereas just styling a span to be bold would be lost on it - so definitely go for using the strong tag. Think of it as a sort of sub heading rather than just as styling.

You can style the strong tag however you want via the CSS but the meaning (i.e. that whatever's within them is important) needs to be emphasised properly with the correct tag - i.e. the strong tag.

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to markhawker)
jaybee

 

Posts: 14157
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: CSS vs. HTML - 6/22/2006 12:23:08   
Shouldn't one be using the emphasis tag for that sort of thing?

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to Tailslide)
Tailslide

 

Posts: 6040
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: CSS vs. HTML - 6/22/2006 12:32:04   
No emphasis is a different thing (strangely!). Without extra CSS styling Strong would be bold to look at and give a semantic meaning of importance compared to surrounding text (I think it's spoken more loudly by screenreaders not sure though) whereas em would be itallic and give a meaning of change of emphasis from the surrounding text not necessarily more important.

Splitting hairs but there is a difference.

BTW they're not straight replacements for the "b" tag and the "i" tag - which are just styling info - they have meaning where the older tags don't

Edit: actually, on reflection I think em isn't just a change of emphasis - it is an increase in importance too (you couldn't really have a change of emphasis downwards I suppose) - just not as much as strong.

< Message edited by Tailslide -- 6/22/2006 12:42:22 >


_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to jaybee)
jaybee

 

Posts: 14157
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: CSS vs. HTML - 6/22/2006 12:53:01   
Why do I see another mess along the lines of abbr and acronym looming? :)

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to Tailslide)
Tailslide

 

Posts: 6040
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: CSS vs. HTML - 6/22/2006 12:53:49   
They're different too although I get into fights about their proper definitions

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to jaybee)
jaybee

 

Posts: 14157
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: CSS vs. HTML - 6/22/2006 12:56:59   
Exactly, they're different but not for long. :)

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to Tailslide)
Tailslide

 

Posts: 6040
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: CSS vs. HTML - 6/22/2006 13:06:16   
They should be different - they have different meanings. I'm not well pleased about the changes. Doesn't suit my pedantic nature!

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to jaybee)
yb2

 

Posts: 653
Joined: 1/30/2006
Status: offline

 
RE: CSS vs. HTML - 6/23/2006 14:30:36   
quote:

Should one use CSS for all formating?


Nah, that's taking a useful tool and using it for the sake of it.

quote:

For example, if I have one word in a sentence that I want to be bold, should I put it in <span> with a class or is it still acceptable to use <strong> tags?


I find it acceptable. But then I find farting and burping acceptable.:):):)

quote:

Or centering a paragraph, should I use a class or is the align attribute acceptable?


Most likely CSS is best for positioning as it's likely to be repeated on other pages.

_____________________________

it is natural for people not to see one's own faults, and to exaggerate other people's faults and failings.
Currently listening to: L'Enfer Des Formes by Stereolab

(in reply to Tailslide)
jaybee

 

Posts: 14157
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: CSS vs. HTML - 6/23/2006 14:37:51   
quote:

Nah, that's taking a useful tool and using it for the sake of it.


Ummmm that's the whole point. You use CSS to take all the formatting out of the page so that all that's left is the content.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to yb2)
yb2

 

Posts: 653
Joined: 1/30/2006
Status: offline

 
RE: CSS vs. HTML - 6/23/2006 15:15:55   
HTML is formatting and is part of the presentation layer, while CSS is only an extension of HTML, and thus does not seperate presentation from content. CSS is useful for making changes to several tags at once, for example site wide formatting, but it's not any more useful than bog standard tags for single-instance formatting and holds no technical advantage in a single instance context.

_____________________________

it is natural for people not to see one's own faults, and to exaggerate other people's faults and failings.
Currently listening to: L'Enfer Des Formes by Stereolab

(in reply to jaybee)
Tailslide

 

Posts: 6040
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: CSS vs. HTML - 6/23/2006 15:28:30   
For single instances it doesn't have an advantage except that it's usually still less markup on the HTML page itself - plus it's just nicer to have it all in one place - not in the markup. Maybe that's just me though - I like things neat!

Edit: oh and obviously there are formatting tags that are deprecated in XHTML strict so you've got no choice but to put it in the CSS - or be invalid (imagine!).

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to yb2)
rdouglass

 

Posts: 9228
From: Biddeford, ME USA
Status: offline

 
RE: CSS vs. HTML - 6/23/2006 16:34:28   
I personally almost always now use CSS "font-weight" and use a class, id, or inline style. So bolding generally involves a <span> tag for me but not always. An addition to this is if I want to change the item dynamically at the client. Then I *always* use a <span> tag.

I know it is more markup but it's easier for me to see these items in code views that way and I always get the expected results when it comes to font stuff. Why fix what ain't broke?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to Tailslide)
yb2

 

Posts: 653
Joined: 1/30/2006
Status: offline

 
RE: CSS vs. HTML - 6/23/2006 16:39:20   
quote:

Maybe that's just me though - I like things neat!


Fair enough if that's your preference, but I think the tidyness argument is a little bit dodgy as you'll end up with as many little bits floating about in your css as anywhere else! :)

quote:

You use CSS to take all the formatting out of the page so that all that's left is the content.

quote:

HTML is formatting and is part of the presentation layer, while CSS is only an extension of HTML, and thus does not seperate presentation from content.


To be fair, I had further look around L'Internet, and a lot of web designers regard xhtml as part of the data layer. Personally, I think that's incorrect, I would consider xml as part of the data layer and xhtml as presentation (transforming xml into xhtml if it was to be viewed in a browser). But since a lot of people won't be using databases and/or xml to store their data, then I can see why it might be viewed in such a way. Perspective is influenced by the technology.

I still wouldn't stick a one-off in .css though, but that's a preference too.







_____________________________

it is natural for people not to see one's own faults, and to exaggerate other people's faults and failings.
Currently listening to: L'Enfer Des Formes by Stereolab

(in reply to Tailslide)
Tailslide

 

Posts: 6040
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: CSS vs. HTML - 6/24/2006 3:01:28   
quote:

ORIGINAL: yb2 I think the tidyness argument is a little bit dodgy as you'll end up with as many little bits floating about in your css as anywhere else! :)


I don't just have CSS rules scattered around my stylesheets willy-nilly you know! Oh no! I organise them neatly into sections so I know what's where. (me? Obsessive? Naaaaah)

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to yb2)
yb2

 

Posts: 653
Joined: 1/30/2006
Status: offline

 
RE: CSS vs. HTML - 6/25/2006 10:53:36   
Nobody round here thinks you're mental in any way...:)

_____________________________

it is natural for people not to see one's own faults, and to exaggerate other people's faults and failings.
Currently listening to: L'Enfer Des Formes by Stereolab

(in reply to Tailslide)
Tailslide

 

Posts: 6040
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: CSS vs. HTML - 6/25/2006 11:19:43   
:) Yeah well for most of the people round here it'd be a case of "Hello Pot, my name's Kettle"

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to yb2)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> CSS vs. HTML
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts