12 replies [Last post]
tmallen
Offline
newbie
Last seen: 16 years 8 weeks ago
Joined: 2006-06-29
Posts: 4
Points: 0

To cut time ffrom having to do <span></span> or <div></div> etc etc I'm considering using custom tags on my pages. I've tested them in Firefox and Safari, and they link and respond to the CSS just fine.

My question:
Will the tags be styled correctly in IE5 and IE6? Do these browsers support custom tags?

thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 23 weeks 4 days ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

Custom HTML Tags plus CSS Compatibility

I doubt it. What do you mean "custom" tags? Are there not enough semantic HTML tags for you to use?

Verschwindende wrote:
  • CSS doesn't make pies

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 1 year 33 weeks ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

Re: Custom HTML Tags plus CSS Compatibility

tmallen wrote:
To cut time ffrom having to do <span></span> or <div></div> etc etc I'm considering using custom tags on my pages. I've tested them in Firefox and Safari, and they link and respond to the CSS just fine.

My question:
Will the tags be styled correctly in IE5 and IE6? Do these browsers support custom tags?

Just don't do it.....

I agree with the need to keep <div>s and <span>s to a minimum but in this case your proposed cure is worse than the disease.

Learn to write semantic, valid html/xhtml and you'll be able to avoid excessive <div>s and <spans> quite easily. Then you'll have valid html, lightweight pages, much better maintainablilty, good access for handicapped browsers, and your pages can still look just as good.

A good start would be to read the article "Divitis: what it is, and how to cure it." in the "How to" forum on this site. Then read some of the other articles in the same forum.

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 39 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Custom HTML Tags plus CSS Compatibility

Are you writing your own custom DTD as well? as that's quite cool always wanted to play with that.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 10 years 2 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Re: Custom HTML Tags plus CSS Compatibility

I take it you are on a Mac.

Paste a link and someone on a Windoze box can check and report back. I tend to doubt it. Safari and Firefox probably aren't fazed due to their XML credentials.

thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 23 weeks 4 days ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

Re: Custom HTML Tags plus CSS Compatibility

Chris..S wrote:
Safari and Firefox probably aren't fazed due to their awesomeness.

Laughing out loud

Verschwindende wrote:
  • CSS doesn't make pies

tmallen
Offline
newbie
Last seen: 16 years 8 weeks ago
Joined: 2006-06-29
Posts: 4
Points: 0

Custom HTML Tags plus CSS Compatibility

thepineapplehead wrote:
I doubt it. What do you mean "custom" tags? Are there not enough semantic HTML tags for you to use?

<score> or <instruction> or <contact> or <toenailcolor>

These tags are essentially semantic, and I'm not putting <div>s everywhere, but it seems like every different text type becomes yet another <ul> class or <p> class.

What I mean is that I'm having a difficult time finding a semantic tag that will apply to a simple line of text that's unassociated (not in a list, so to speak), or a similar unit. Too minor for <p>, but not anything tidy like an <abbr> or <acronym>, and I don't want to bend these tags and lose their real meanings. Is the <br> really off-limits...?

thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 23 weeks 4 days ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

Custom HTML Tags plus CSS Compatibility

Not entirely, it's useful for separating things that need to be separated.

However, if you edit your own doctype to validate with the custom tags, and they work in browsers and you can style them, go for it! Hasn't been tried here before, afaik Laughing out loud

Verschwindende wrote:
  • CSS doesn't make pies

tmallen
Offline
newbie
Last seen: 16 years 8 weeks ago
Joined: 2006-06-29
Posts: 4
Points: 0

Custom HTML Tags plus CSS Compatibility

I web designer. Me no build DTD. *grunt*

I think i need to evolve now.

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 10 years 2 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Custom HTML Tags plus CSS Compatibility

All we're talking about here is a few extra bits of typing. Or if you are using php or some other scripting language simply post process your output to replace

<(scorer|instruction|toenailcolor)(.*)> with <span class="$1"$2>

HellsBells
HellsBells's picture
Offline
Leader
Bedford, UK
Last seen: 14 years 23 weeks ago
Bedford, UK
Joined: 2004-04-07
Posts: 851
Points: 0

Custom HTML Tags plus CSS Compatibility

Problem is that unless you're using XML those tags won't have any sort of semantic meaning which is generally a bad idea as varying devices might not know what to do with them.

My strategy is so simple an idiot could have devised it!

"Also, your CSS (no offence) makes me want to gouge my eyes out with a rusty spoon" - TPH

tmallen
Offline
newbie
Last seen: 16 years 8 weeks ago
Joined: 2006-06-29
Posts: 4
Points: 0

Custom HTML Tags plus CSS Compatibility

So what you mean is that a mobile device, for example, wouldn't know to display as 'block' (basic layout component, and really what I'm aiming for is just that plus some font control) a custom tag? My little Samsung mobile here always reads the stylesheet since I've tested some normal XHTML semantic markup from my pages on it. It has succesfully displayed the colors and font-sizes, but I am not sure whether my left nav bars displayed line-by-line because I declared them display:block, or because phones always display links as block.

HellsBells
HellsBells's picture
Offline
Leader
Bedford, UK
Last seen: 14 years 23 weeks ago
Bedford, UK
Joined: 2004-04-07
Posts: 851
Points: 0

Custom HTML Tags plus CSS Compatibility

I was thinking more screenreader than mobile - also not necessarily stuff in the here and now.

Just thinking out loud that XTHML is meant, as far as I know, to retain the same semantic tags as HTML does rather than use customised ones as XML would be able to.

Particularly as most XHTML sites are actually just HTML with errors as far as many browsers (and mobiles, PDAs etc apart from those using Opera) are concerned - so in effect you're using customised tags in HTML which can't be right.

Just because the CSS styling works, I'm not sure it's a good idea.

My strategy is so simple an idiot could have devised it!

"Also, your CSS (no offence) makes me want to gouge my eyes out with a rusty spoon" - TPH