Solved

Canceling earlier css script

Posted on 2013-11-27
5
170 Views
Last Modified: 2013-11-28
If I wanted the following to be canceled what would the syntax be?

border: 2px solid #000;

border: none;
0
Comment
Question by:burnedfaceless
5 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39682718
You can't 'cancel' a CSS declaration but you can replace it.  CSS definitions are applied in the order that they are found on a page.  If you have a <style> section and a CSS file link in the <head>, the one that comes Last (for any particular element) is the one that is applied.  After that, any 'inline' 'style' attributes are applied.

Note that if you change the color with 'border-color', that's all that it changes.  The width and style remain the same until you change them.
0
 
LVL 13

Accepted Solution

by:
duncanb7 earned 250 total points
ID: 39682894
I think you want to control  CSS style in your page  for some html tags or area  individually
and effeciently. If so,

you might be interested in the following articles about CSS style precedence

http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/
http://css-tricks.com/specifics-on-css-specificity/
http://www.w3.org/TR/CSS2/cascade.html

Hope understand your question completely. If not please point it out

Duncan
0
 
LVL 17

Assisted Solution

by:nanharbison
nanharbison earned 250 total points
ID: 39683718
As DaveBaldwin says, f you replace the CSS for the border, it has to be the last CSS rule read by the page, so the style sheet that contains border:none has to come after the previous border rule.
But also, is your replacement rule in a separate style sheet, so you can look at the html on the page and make sure the replacement rule style sheet is last?
Or have you embedded this replacement rule in the html on one particular page, which comes after rules on a style sheet.? Or you can do it inline right in the div or whatever needs the replacement rule. That rule is the last one read.
0
 

Author Closing Comment

by:burnedfaceless
ID: 39684246
Thanks
0
 
LVL 13

Expert Comment

by:duncanb7
ID: 39684263
Thanks for your pt

Have a nice day

Duncan
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question