Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
which of these is more semantic/standards compliant?
Old 01-29-2009, 11:15 PM which of these is more semantic/standards compliant?
yarrgh's Avatar
Skilled Talker

Posts: 82
Trades: 0
Example 1:

Code:
h1 { font: arial 20em/25em bold wider; }
Example 2:

Code:
h1 span { font: arial 20em/25em bold wider; }
In other words, is it ok to apply style directly to a semantic tag such as <h1> or would it be better to put a <span> inside it and apply the style to the <span> only? I have a co-worker who argues adamantly that example 1 is non-semantic.
__________________
no sig.
yarrgh is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-30-2009, 12:01 AM Re: which of these is more semantic/standards compliant?
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
I don't think that one is semantic over the other, though I would go for example 1 because it requires less code.

- Steve
stevej is offline
Reply With Quote
View Public Profile
 
Old 01-30-2009, 02:17 AM Re: which of these is more semantic/standards compliant?
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
I think the first one might be a bit overdone and I would instead assign a class to the h1 tag, and use h1.classname in the CSS instead.
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 01-30-2009, 04:44 AM Re: which of these is more semantic/standards compliant?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,522
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Either one would be perfectly correct

Example 1 would be used if all the text in all <h1> elements were to be the same.

Example 2 would used when you wanted a change of style applied to a block of text (child element) within the heading.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-30-2009, 01:49 PM Re: which of these is more semantic/standards compliant?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Personally, I never use the font: selector, and instead use font-family:, then make a separate selector for font-size:, font-weight:, etc...
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Reply     « Reply to which of these is more semantic/standards compliant?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.53060 seconds with 12 queries