?
Solved

Canceling earlier css script

Posted on 2013-11-27
5
Medium Priority
?
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 1000 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 1000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

801 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