RSS Feed

CSS is Important!

What does !important mean within the Cascading Style Sheet of a webpage? It means that whatever other styles are applied afterwords, that first – or most important – style remains. It means that you won’t accidentally override a style you do want to apply universally.

So in this example:
p { color: #ffffff; }
p { color: #000000; }
the paragraph text color will be black (#000000), although white is given in the first instruction (#ffffff).
This is because the styles are applied in a cascading manner, hence the name cascading style sheets. Formatting from a style sheet is applied first and foremost (and will apply if no other formatting is defined), but can be overriden by inline styles, such as <p style=”color: #ffffff”…> </p> 


OR by using !important in your CSS. So in this example:

p { color: #ffffff !important; }
p { color: #000000; }

the paragraph style will always have white text.

More information from this nice lady: http://webdesign.about.com/od/css/f/blcssfaqimportn.htm

Advertisements

About fruitfulcommunications

Work in marketing and customer service. Enjoy yoga, eating out, banter, wine and theatre. Live in Merchant City, Glasgow.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: