[WEB4LIB] Can an element have two class attributes?

Randy Norwood randy.norwood at ttu.edu
Tue Apr 19 08:33:34 EDT 2005


I don't think that's allowed within one element. Besides, how would that
work? How would the browser determine which class to apply in a particular
page request? You might need a Javascript event handler to capture the
triggering event and then perhaps some more JS to perform the desired
action. It really depends on what you're trying to do--what is the trigger
and what are the actions?


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Randy Norwood
Web  Manager
Texas Tech University Libraries
Office: 806-742-2238  x236
Fax: 806-742-8669
E-mail: randy.norwood at ttu.edu




On 04/19/05 6:24 AM, "John Fitzgibbon" <jfitzgibbon at Galwaylibrary.ie> wrote:

> Hi,
> 
> I am writing to enquire if an element can have two class attributes. I'm
> using JavaScript to hide or display an element based on two
> contingencies. Is the following allowed?
> 
> <div class="reason1" class="reason2">Text to be hidden or
> displayed</div>
> 
> Or should I use the next approach?
> 
> <div " class="reason2"><div class="reason1>Text to be hidden or
> displayed</div></div>
> 
> 
> I know an element is allowed only one id attribute but do not know what
> the position is with regards to class. I have never seen an element with
> two class attributes.
> 
> Any ideas would be most welcome.
> 
> John Fitzgibbon
> 
> Galway Public Library
> Island House
> Cathedral Square
> Galway
> Ireland
> 
> p: 00 353 91 562471
> f: 00 353 91 565039
> w: http://www.galwaylibrary.ie
> 
> *******************************************************************
> Tá eolas atá príobháideach agus rúnda sa ríomhphost seo
> agus aon iatán a ghabhann leis agus is leis an duine/na daoine
> sin amháin a bhfuil siad seolta chucu a bhaineann siad.
> Mura seolaí thú, níl tú údaraithe an ríomhphost nó aon iatán
> a ghabhann leis a léamh, a chóipáil ná a úsáid.
> Má tá an ríomhphost seo faighte agat trí dhearmad,
> cuir an seoltóir ar an eolas thrí aischur ríomhphoist
> agus scrios ansin é le do thoil.
> 
> This e-mail and any attachment contains information which is
> private and confidential and is intended for the addressee
> only. If you are not an addressee, you are not authorised
> to read, copy or use the e-mail or any attachment.
> If you have received this e-mail in error, please notify
> the sender by return e-mail and then destroy it.
> *********************************************************************
> 
> 





More information about the Web4lib mailing list