VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-ASP Shopping Cart Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 VP-ASP 7.0 Questions
 Text Colour marked as !important
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Sharon
VP-ASP Super User

353 Posts

Posted - April 04 2013 :  10:57:30  Show Profile  Visit Sharon's Homepage  Reply with Quote
I am currently changing the colour-scheme on my site.

Can anyone tell me why the following text colour (from layout.css) is important?

quote:
#main h2 a{
font: bold 14px/18px Arial, Helvetica, sans-serif !important;
color:#fff !important;
}

carfin
VP-ASP Expert

United Kingdom
948 Posts

Posted - April 04 2013 :  11:40:33  Show Profile  Reply with Quote
Hi Sharon,

I have no idea. I''ve just checked our site and there are no main content titles (h1, h2, h3) that will ever have links generated for them so unless someone else can shed light on this, I would just leave the code alone.

Regards,

Carrol
www.deanston-electrical.co.uk
Go to Top of Page

Sharon
VP-ASP Super User

353 Posts

Posted - April 05 2013 :  05:03:28  Show Profile  Visit Sharon's Homepage  Reply with Quote
Hello Carrol,

In the body section of my home page I have enabled the News ''Highlights box. The ''News'' title links to shopnewslistings.asp.

This is the only box I have enabled that generates a link from the H1 title & so is the only one that looks different as I have altered the text colour for #main h1.

None of the values in the #main h1 selector are marked as important, yet both values for #main h1 links are marked as !important, including the hover state.
Go to Top of Page

diegomilito
VP-ASP Expert

Argentina
723 Posts

Posted - May 01 2013 :  04:58:39  Show Profile  Reply with Quote
the ------!important-------- means that the styles are applied in order as they are read by the browser. The first style is applied and then the second and so on. What this means is that if a style appears at the top of a style sheet and then is changed lower down in the document, the second instance of that style will be the one applied, not the first. For example, in the following style sheet, the paragraph text will be black, even though the first style property applied is red:

p { color: #ff0000; }
p { color: #000000; }

The !important rule is a way to make your CSS cascade but also have the rules you feel are most crucial always be applied. A rule that has the !important property will always be applied no matter where that rule appears in the CSS document. So if you wanted to make sure that a property always applied, you would add the !important property to the tag. So, to make the paragraph text always red, in the above example, you would write:

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

diego.
Go to Top of Page

Sharon
VP-ASP Super User

353 Posts

Posted - May 01 2013 :  05:34:13  Show Profile  Visit Sharon's Homepage  Reply with Quote
Thanks diego, great explanation.
Go to Top of Page

diegomilito
VP-ASP Expert

Argentina
723 Posts

Posted - June 15 2013 :  04:15:54  Show Profile  Reply with Quote
i love to share for all :)
Diego.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000