473,589 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML/XHTML and tag attributes

(if this isn't the place for XHTML, I'd appreciate a redirect)

According to the w3's web site, some non-HTML 4 browsers won't
properly interpret non-minimized boolean attributes, i.e.

<option value="blah" selected="selec ted">...</option>
^^^^^^^^^^^

Can anyone tell me what browsers those might be? I'm in the process
of converting some marginal HTML to something resembling XHTML, and
I'd like to maintain compatibility with a reasonable set of browsers.

And as long as I'm blithering about XHTML, to what extent do you think
use of the deprecated (HTML 4) and nonstandard (XHTML 1.0) <font> tag
is acceptable? We're not shooting for strict XHTML compliance here,
and <font> is a lot easier than XHTML's inline styles...

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
Jul 20 '05
50 3826
"Christophe r Benson-Manica" <at***@nospam.c yberspace.org> wrote in message
news:bp******** **@chessie.cirr .com...
Hm... well, as I've alluded, the vast majority of this code wasn't
written by me, and in defense of the people who did (i.e., the people
I work for), it was written several years ago, when this stuff might
still have been (marginally?) acceptable...


That's certainly understandable. I recently had the misfortune of updating
a site I had done a few years back when CSS was not widely supported by
browsers. It worked, but it was so cluttered. :)

Did you understand what I was saying though about why it's a bad thing to
create classes like "red"?

Regards,
Peter
Jul 20 '05 #11
Peter Foti <pe****@systoli cnetworks.com> spoke thus:
That's certainly understandable. I recently had the misfortune of updating
a site I had done a few years back when CSS was not widely supported by
browsers. It worked, but it was so cluttered. :)
Hm. CSS is okay for pretty much all browsers around these days
though, right? I think we officially support IE 4 and Netscape 4,
maybe a little lower than that...
Did you understand what I was saying though about why it's a bad thing to
create classes like "red"?


Yes, I appreciate that :) Although there are some instances where it
almost isn't worth the trouble for a whole CSS class, like in one
place where the code is <font size=-1> - is that worth a class...?

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
Jul 20 '05 #12
Christopher Benson-Manica:
So what's the best way to replace instances of <font color="red">red </font>


It all dependas on the _reason_ that text should be red. If it's because
that text is somehow emphazised, then this is the best solution:

<em>red</em>

With something like this in an external style sheet:

em { color: red; background: inherit; }

If you only want some of your "em"s to be red, do this:

<em class="whatever ">red</em>

With something like <this in an external style sheet:

em.whatever { color: red; background: inherit; }

If you later change your mind, and find that all those emphasized words
of the "whatever" kind, really should be blue, you just change in your
external style sheet:

em.whatever { color: blue; background: inherit; }

If all those words are not emphasized, and if there is no other HTML
element that correctly describes what they are, then use the element "span":

<span>red</span>

With something like this in an external style sheet:

span { color: red; background: inherit; }

Or:

<span class="whatever ">red</span>

With something like this in an external style sheet:

span.whatever { color: red; background: inherit; }

--
Bertilo Wennergren <be******@gmx.n et> <http://www.bertilow.co m>

Jul 20 '05 #13
"Christophe r Benson-Manica" <at***@nospam.c yberspace.org> wrote in message
news:bp******** **@chessie.cirr .com...
Peter Foti <pe****@systoli cnetworks.com> spoke thus:
That's certainly understandable. I recently had the misfortune of updating a site I had done a few years back when CSS was not widely supported by
browsers. It worked, but it was so cluttered. :)


Hm. CSS is okay for pretty much all browsers around these days
though, right? I think we officially support IE 4 and Netscape 4,
maybe a little lower than that...


NS4 is quite obsolete. My recommendation would be to hide CSS from NS4
because it's implementation is so screwy. Thus, you would let the content
degrade gracefully for a NS4 browser... the content would still be
available, but it wouldn't be beautified by CSS.

Did you understand what I was saying though about why it's a bad thing to create classes like "red"?


Yes, I appreciate that :) Although there are some instances where it
almost isn't worth the trouble for a whole CSS class, like in one
place where the code is <font size=-1> - is that worth a class...?


Any place where you are controlling the presentation is worth handling with
CSS. For instance, maybe you had:
<font size=-1>Copyright (c) My Makebelieve Company</font>

Instead, you could do:
<span class="copyrigh t">Copyright (c) My Makebelieve Company</span>

And then control the display with CSS. Now if you decided that you wanted
to change the font size of your copyright, you don't need to modify every
single HTML page that has the copyright info on it... instead, you just make
the change in 1 place (the CSS file).

Regards,
Peter

Jul 20 '05 #14
On Thu, 20 Nov 2003, Christopher Benson-Manica wrote:
Peter Foti <pe****@systoli cnetworks.com> spoke thus:
Did you understand what I was saying though about why it's a bad thing to
create classes like "red"?
Yes, I appreciate that :)


Let's see...
Although there are some instances where it
almost isn't worth the trouble for a whole CSS class, like in one
place where the code is <font size=-1> - is that worth a class...?


No, it seems you didn't.

What does <font size="-1"> mean to a speaking browser? To an indexing
robot?

HTML doesn't have <aside> or <incidentally > or <by-the-way> tags, but
at least you could meet it half way with <small class="incident ally">
linked (if you want) to an audio stylesheet suggesting a different
voice.
Jul 20 '05 #15
Christopher Benson-Manica <at***@nospam.c yberspace.org> wrote in
news:bp******** **@chessie.cirr .com:
(if this isn't the place for XHTML, I'd appreciate a redirect)
This is the appropriate place.
And as long as I'm blithering about XHTML, to what extent do you think
use of the deprecated (HTML 4) and nonstandard (XHTML 1.0) <font> tag
is acceptable?
IMHO, to no extent.
We're not shooting for strict XHTML compliance here,
and <font> is a lot easier than XHTML's inline styles...


Not really. It will *seem* to be easier if you don't yet understand CSS,
but once you understand CSS, <font> will actually seem a lot harder. The
big problem with <font> is that it scatters font-size and font-family
decisions all over your site, whereas CSS lets you put them all in one
place.

You're right that inline styles are awkward, but then they're generally the
worst way to do author-written styling (IMHO, inline styles should be used
only for script-driven dynamic styling). But once you learn how to gather
presentational directives into one (or maybe a few for large sites)
stylesheet(s), you'll wonder how you ever managed to cope with having
styling information distributed all over lots of individual documents.
You'll find yourself doing a lot more styling experiments once you learn
how to change every page in your site by changing a few lines in a single
file, and that will ultimately result in better design because the cost (in
time and effort) of improving your design will be so low.
Jul 20 '05 #16
Alan J. Flavell:
HTML doesn't have <aside> or <incidentally > or <by-the-way> tags, but
at least you could meet it half way with <small class="incident ally">
linked (if you want) to an audio stylesheet suggesting a different
voice.


Are there any user agents of programs around that are able to find any
meaning in 'class"incident ally"'? Actually it's just as meaningless as
"<font>". Using "class" is still better practice, but we shouldn't fool
ourselves that it conveys any meaning, except perhaps to a human that
has a look at the HTML code.

--
Bertilo Wennergren <be******@gmx.n et> <http://www.bertilow.co m>

Jul 20 '05 #17
Bertilo Wennergren wrote:
Alan J. Flavell:
HTML doesn't have <aside> or <incidentally > or <by-the-way> tags,
but at least you could meet it half way with <small
class="incident ally"> linked (if you want) to an audio stylesheet
suggesting a different voice.


Are there any user agents of programs around that are able to find
any meaning in 'class"incident ally"'? Actually it's just as
meaningless as "<font>". Using "class" is still better practice, but
we shouldn't fool ourselves that it conveys any meaning, except
perhaps to a human that has a look at the HTML code.


Which is also a problem when it comes to the concept of
user-stylesheets. And why they won't really ever work except for the
most basic h1, h2, p, etc., which is just not enough to mark-up a
richly formatted site.

It would be nice if there would at least be tags or a class-standard
for the most-needed types of structure, like footnote, navigation, tip,
toc, note, warning, announcement, moreInfo, or whatever you may call
those*. Even I myself when working with my own stylesheets sometimes
can't remember what I called this or that class (because there are
thousands of pages out there created at different times etc.).

On the other hand HTML includes some phrase-elements which I rarely or
never use, such as samp, kbd, var, code, and so on. It seems a bit like
those were created from the point-of-view of writing technical
tutorials. On the other hand, for really basic mark-up there should be
less elements rather than more. (I could really give up on samp etc.,
though I sometimes use them.) And then there's the unnecessary
"acronym" (which is needed pretty much only for IExplorer 'cause it
doesn't understand "abbr")...

*<http://groups.google.com/groups?selm...41%40news.t-on
line.com&oe=UTF-8&output=gplain >
Jul 20 '05 #18
Peter Foti <pe****@systoli cnetworks.com> spoke thus:
NS4 is quite obsolete. My recommendation would be to hide CSS from NS4
because it's implementation is so screwy. Thus, you would let the content
degrade gracefully for a NS4 browser... the content would still be
available, but it wouldn't be beautified by CSS.
(un)Fortunately , the HTML in question is actually being generated by
CGI's, so I can actually use the <font> tag for NS4 and a stylesheet
for IE4+ and NS6 without issue (right?).

As far as obsolescence is concerned, it could be worse - for awhile we
had people using IE 3 (courtesy of WebTV or something)... *that* was
unpleasant ;)
Any place where you are controlling the presentation is worth handling with
CSS. For instance, maybe you had:
<font size=-1>Copyright (c) My Makebelieve Company</font>
Unfortunately not - these are all just random places where we
basically said "Hey, these two words need to be smaller than the
others." So each page touched by my tainted hand will have its own
<style> tag...
And then control the display with CSS. Now if you decided that you wanted
to change the font size of your copyright, you don't need to modify every
single HTML page that has the copyright info on it... instead, you just make
the change in 1 place (the CSS file).


As lovely as that sounds, I don't have the luxury...

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
Jul 20 '05 #19
On Fri, 21 Nov 2003, Bertilo Wennergren wrote:
Alan J. Flavell:
HTML doesn't have <aside> or <incidentally > or <by-the-way> tags, but
at least you could meet it half way with <small class="incident ally">
linked (if you want) to an audio stylesheet suggesting a different
voice.
Are there any user agents of programs around that are able to find any
meaning in 'class"incident ally"'?


No: it's a human-meaningful token for tying the stylesheet to the
HTML.

I'm sorry if I didn't make my meaning clear in that regard.
Actually it's just as meaningless as "<font>".
Mark-up doesn't care what the content means, either. But an author or
sub-editor can make good use of human-meaningful linkages IMHO.
Using "class" is still better practice, but we shouldn't fool
ourselves that it conveys any meaning, except perhaps to a human that
has a look at the HTML code.


I've no argument there, but would it _really_ be better for humans if
all the class names were meaningless gibberish? We shouldn't fool
ourselves that human-meaningful class names are of significance to the
program - that's your point - but don't knock the idea of them being
human-meaningful. A lot better than class="smallgre enverdana" anyway.

Jul 20 '05 #20

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

Similar topics

3
5267
by: Andy | last post by:
Could anybody tell me what is the main differences betwwen XML and HTML? Thank you.
1
1540
by: mike | last post by:
regards: A HTML document can be converted to XHTML document. one step is:'Un-minimize' minimized attributes What does the step mean in easy english?...@@. I mean what operations I should do on the attributes? Any suggestion is welcome.
2
2857
by: mike | last post by:
regards: I follow the following steps to converting from HTML to XHTML http://webpageworkshop.co.uk/main/xhtml_converting My parser is http://htmlparser.sourceforge.net/ Xhtml version is 1.0 from http://nds.nokia.com/uaprof/N6600r100.xml but nokia mobile browser cannot identify the converted file(XHTML1.0). Is there something wrong with my procedure.
9
1996
by: Patient Guy | last post by:
Taking the BODY element as an example, all of its style attributes ('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML 4.01, a fact noted in the DOM Level 2 HTML specification. The DOM specification does not explicitly itself deprecate the use of attributes however for the element in the interface definition section I read. Is there text in the DOM specification that states specifically that the DOM specification...
7
3673
by: Kersh | last post by:
I'm trying to implement XHTML standards in my ASP.NET web pages but whenever I use web controls I get problems because of the very strict nature of W3C XHTML (transitional version is picky but strict1.1 very severe!) e.g. align="Center" fails validation because of the capital "C" - this makes asp:Calendar control unuseable because it happens to use this tag for each of the cells. Also Javascript tags require a 'type' attribute...etc
4
1591
by: Arthur Dent | last post by:
Hello all, ive been programming with ASP.NET since it came out, but am just getting my feet with now with v.2. Ive noticed something strange in the way my HTML tables get rendered with 2. I use tables to layout my pages, doing three rows, a header, content and footer. When i do this, i make the tables height=100%, so the footer always shows up at the very bottom of the page. With 2.0/2005 though, when it renders the pages, it doesnt...
6
4499
by: jiing24 | last post by:
I try to use regexp to replace some html tags in DOM, but the result seems some problems, ================================ <Script language="javascript" type="text/javascript"> var config = document.getElementById("rootconfig"); alert(config.innerHTML);
15
2051
by: Jake Barnes | last post by:
I'm trying to learn AJAX so tonight I sat down and came up with a little toy that I can do tests with. You can see it here: http://www.publicdomainsoftware.org/ajaxExperiment.htm I've got Stuart Langridge's book "DHTML Utopia: Modern Web Design using Javascript and DOM" which seems pretty good. It covers the basics. The next thing I'd like to do is add a Save button to this little page I came up with. I may use Sam Stephenson's...
11
2772
by: Nathan Sokalski | last post by:
I add several JavaScript events (onchange, onkeypress, etc.) to Controls using the Add method of the Attributes collection. However, if the JavaScript code contains certain characters, such as & or < or several others, it converts them to html, such as &amp; or &lt; which can sometimes cause my scripts not to work. How can I prevent ASP.NET from doing this? Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
0
7865
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8233
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8360
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8224
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5399
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3849
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3889
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2374
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1461
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.