You are here: Re: CSS classes and IDs « HTML « IT news, forums, messages
Re: CSS classes and IDs

Posted by Toby Inkster on 11/30/06 11:37

Agix wrote:

> can an element in code have a class(es) and an ID?

An element can have zero or one IDs, and zero or more classes. So you
could for example have:

<DIV id="quux" class="foo bar baz">
Example
</DIV>

And you could make that text stand out using the following CSS:

#quux { font-weight: bold; }
..foo { color: red; }
DIV.bar { background: yellow; }
..baz#quux { font-size: 150%; }
..foo.baz.bar { text-decoration: underline; }

That last line of CSS, selecting by multiple classes, wouldn't be
supported by IE 6 and below though. (IIRC.)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация