Click here to get back home

Class attribute values

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Class attribute values Patient Guy 11-07-2005
Get Chitika Premium
Posted by Patient Guy on November 7, 2005, 7:27 am
Please log in for more thread options



While the values of 'id' and 'name' attributes include restrictions on the
use of characters such as beginning with a letter, the values of the
'class' attribute define no restriction as I can find.

Thus the use of:

class="thumbedImage 0.4"

is permitted, and could be used as an attribute in IMG elements to identify
images whose sizes I want to change dynamically with the loading of the
document body through a script function call, as the "onload" attribute is
not allowed for IMG elements in the specification.
(The script function essentially would get a list of image element nodes
from the document body, examine the class attribute values for the presence
of the correct values, and then make changes to those images having the
required values.)

Is there anyone whose understanding of the specification differs from this
understanding?



Posted by Stephen Poley on November 7, 2005, 9:24 am
Please log in for more thread options


On Mon, 07 Nov 2005 07:27:04 GMT, Patient Guy

>While the values of 'id' and 'name' attributes include restrictions on the
>use of characters such as beginning with a letter, the values of the
>'class' attribute define no restriction as I can find.
>
>Thus the use of:
>
> class="thumbedImage 0.4"
>
>is permitted, and could be used as an attribute in IMG elements to identify
>images whose sizes I want to change dynamically with the loading of the
>document body through a script function call, as the "onload" attribute is
>not allowed for IMG elements in the specification.
...
>Is there anyone whose understanding of the specification differs from this
>understanding?


Well, I couldn't immediately find something prohibiting that. However:

class="thumbedImage 0.4" assigns the classes "thumbedImage" and "0.4"
to the element.

In CSS, img.0.4 { ... } would refer to images having the class 0 and
the class 4.

In fact in CSS: "identifiers (including element names, classes, and IDs
in selectors) can contain only the characters [A-Za-z0-9] and ISO 10646
characters 161 and higher, plus the hyphen (-); they cannot start with a
hyphen or a digit."

Even if you can use periods in HTML class-names, it seems to me that it
would be inadvisable.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/

Similar ThreadsPosted
splitting long attribute values February 16, 2007, 10:05 pm
sending hidden values AND option values at the same time ? September 12, 2006, 12:52 am
Smallest Possible width values April 1, 2005, 6:02 am
how pass option values to JS routine? November 18, 2007, 10:16 am
Form Reload with Tainted Values April 28, 2008, 5:13 pm
forms that look like grids -- are values correlated? June 5, 2008, 2:13 pm
receipt of form values by an HTML page October 10, 2007, 2:56 pm
class="" December 15, 2005, 10:13 am
How can I change the value in a css class? October 18, 2005, 9:04 am
CSS trouble - div.class div.class2 September 30, 2004, 1:03 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap