You are here: Re: class attribute selection and assignment « HTML « IT news, forums, messages
Re: class attribute selection and assignment

Posted by Jonathan N. Little on 04/15/07 20:52

Jon Slaughter wrote:
> Is it possible to do something like assign to an attribute
> SomeClass.SomeAttribute? If not it should be?

No. You can define a class to be different for different ELEMENTS

P.bigboy { font-size: 2.5em; color: blue; background-color: white; }
LI.bigboy {font-size: 1.5em; color: white; background-color: black; }

You can style ELEMENTS with certain ATTRIBUTES

/* Only ACRONYMs that have a title, but IE again will not coop */
ACRONYM[title] { border: 1px dotted silver; }

>
> I have two spots where I use the same value and they have to be the same
> value at all times. Basically I have to use two divs that have the same
> width but one is transparent with a higher z-order and the other supplies
> the background color with a lower z order(while something sits inbetween).
> In any case, I have to set the width to the same value but I'd rather just
> keep it in one spot. Would be nice if I could just use
> width:OtherClass.width; instead of later on forgetting that I had two spots
> and end up only changing one.

You can apply more than one CLASS to an ELEMENT...

..FrameUp { border: 5px inset blue; padding: .5em; }
..Landscape { height: 10em; width: 15em; }
..Portrait { height: 15em; width: 10em; }


<div class="FrameUp Landscape">Framed Landscape</div>
<div class="FrameUp Portrait">Framed Portrait</div>

BTW: Most times z-index fiddling is not required, only on positioned
elements and normally can be avoided by the order within the markup.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

 

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

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