Solved

Canceling earlier css script

Posted on 2013-11-27
5
164 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 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks
0
 
LVL 13

Expert Comment

by:duncanb7
Comment Utility
Thanks for your pt

Have a nice day

Duncan
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
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…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now