CSS - Override Parent Styles?
I made a few tables using the old HTML method o setting table attributes.
However I later discovered css for tables and wrote the following and it works well with some new tables i have made: Code: table { border-collapse: collapse; border-spacing: 0px; } Now all my old tables follow the above style (quite naturally). How can I override the css styles for the older tables? how do i set border-spacing to its default value? thanks Similar TutorialsI have the following in my css: Code: input, textarea, select { font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ECEEF1; border: 1px solid #505355; color: #505355; margin: 3px; font-size: 10px; } input:hover, textarea:hover, select:hover { background-color: #FFE7DB; border: 1px solid #D64800; color: #D64800; } and then I have something like this on my page: <input name="rate" type="radio" value=6 onclick="this.form.submit()" class="rateradio" /> How can I make the class selector 'rateradio' to override the background-color and border options in the input and input:hover css? I have some inputs wich I want that css to work but some inputs I want to override the background color and the border, how can I do it? Is there a way to get the style sheet to let the inner tag to override the parent's tag? Seem that only one webpage need that while many other doesn't. I'll post the code below, take a look at the text-align:left ...... Code: <div style="margin:0px;padding:25px 30px;text-align:left;"> <img style="text-align:center;" src="..."> </div> Is there a way to get the style sheet to let the inner tag to override the parent's tag? Seem that only one webpage need that while many other doesn't. I'll post the code below, take a look at the text-align:left ...... Code: <div style="margin:0px;padding:25px 30px;text-align:left;"> <img style="text-align:center;" src="..."> </div> I'm new to CSS, and I've been working with Wordpress. While learning CSS, I'm experimenting with various things in HTML, Php, and Javascript. I'm often finding myself wanting to override the CSS settings implemented by Wordpress. However, I don't want the settings overridden for every page - just the particular one I'm working on. In other cases, I only want the CSS overridden for a few lines of code (such as font type). This kind of problem is making me think writing customized CSS/Php is worth exploring. I spend twenty minutes coding something to spend an hour trying to integrate it with Wordpress. A quick question about how to over-ride style on the <a> tag: I have the following css: Code: #menu a { display:block; padding:8px 12px; background:#5a5152 url(images/seperator.gif) bottom right no-repeat; color:#ccc; text-decoration:none; } #menu a:hover { background:#2580a2 url(images/hover.gif) bottom center no-repeat; color:#fff; } I want to override this for the last menu item to get rid of the separator on the last menu item on the right - but want to keep everything else. I have tried the following which does what I want but I lose the hover effect: Code: <a style="clear:both; display:block; padding:8px 12px; background:#5a5152 bottom right no-repeat; color:#ccc; text-decoration:none;" href="contact.php" title="Contact Us">CONTACT US</a> How do I add in the hover to the above override or is there abetter way to do this? I have 2 css files. One main one that I am using Code: input[type="text"], select { background: #FFF !important; } I use that mainly for Firefox as without it the form fields are yellow. but I would like to override that have have one form field on this one page stick out and have it like this. Code: .CCfield { color: Black; background: #FFFF66; } Is this doable? How can I override it for this one field? Thanks I have setup a style for the <A> Tag which will be used throughout the site. Code: a { cursor:pointer; color: #8E9300; text-decoration: underline; } I have one div on one of the pages that contains some links, on this one div I would like to redefine the <a> tag or override it but not affect the <a> tags on the rest of the site. How can I do this? Thanks. Hi can anyone tell me if I can override embedded CSS with a linked stylesheet? Here is what I want to change: Code: <col width="40%" style="background-color:#EEEEEE;text-align:left;"> I want to change the background-color without changing anything in the above mentioned code, this means I want to change it with an extern stylesheet. Hi there. I have a print style that won't display images when printing.. img {display: none;} I have a certain page where I need the print style sheet but will like the images to print. How can I override the print style for the images? I have a CSS that manages my site, but I've got a list of links that are dynamicly created with php/mysql. I have two lists that I would like to use non-CSS colors for their links. Is there a way to override the CSS to force certain colors on the links? I've tried using the normal <p> or style settings, but the main links portion of the CSS always takes precedence and I can't seem to make it work for me. A little background for you...the lists are as follows: 1 - a list of currently open jobs in the company 2 - a list of all jobs in the company Both lists are also links to the job descriptions. List 1 is created based on whether the database has the job flagged as open, so its never static. List 2 is not static either because it lists the jobs in the database. Is there a way to override CSS padding to use cellpadding instead or can inheritance be prevented? I have a CMS and I want editors to still be able to use the cellpadding attribute rather than make a class for each desired padding. I am not able to set a defining ID or class on the table as it's generated with our CMS. The relevant tables are contained in a defined parent class. Code: TD{ padding: 0px; } .custom TD{ /*padding: ignore;*/ } Code: <span class="custom"> <table cellpadding="5"> ... </table> <span> Hi, I'm wondering if it is possible to override style settings in an external html document. I'm using the <--#include file command to include a html file. I don't want to modify the html file, because people (here at work) are making documents in word9 and save it to html. The major problem is that the <hr> line is too long and so is the text, so it don't fit on our website, at this point these documents are opened in a new window, but it would be nicer to intergrate them into our site. thanks -Dan So I have an ad that is being served via an IFRAME. The src of the iframe has a few places where I can change colors as the css is dynamic based on the query string. There is one css element that is not supported with the user option to change the color and I want to try and override it. Obviously inline styles override embedded styles, but the element I need to override is span.price { color:#990000; } and that is within the source of the iframe. Is there a way to override this? Hello, I'm an amateur with CSS, and would appreciate if you could take some time to help me out! I have a CSS rule to render all bullets in my page with a different icon, including on the sidebars. But there's one single list (a secondary navigation bar) where I do not want any bullets. I am trying to override it, but am unable to. I'd be glad if you could review my CSS and tell me where I'm going wrong. Thanks a Ton! Code: .sidebar li { border-top:dashed #cccccc 1px; } .sidebar ul li { padding:0 0 0 1.5em; list-style-type: none; list-style-image: none; background-image: url(img/menu-leaf.gif); background-repeat:no-repeat; background-position: 0.3em 0.6em; } This is my navigation block Code: #navigation-secondary a { display:block; color:#ffffff; } #navigation-secondary a:hover { background-color:#369; /* to change color when hovered over */ } The following method to override it doesn't work Code: #navigation-secondary , #navigation-secondary ul, #navigation-secondary ul li, #navigation-secondary a { list-style-type:none; list-style:none; } ul.secondary-links li, ul.secondary-links ul li { background-image:none; border-top: none; } I should mention, the top border has been overridden, but not the background image. My html code snippet (rendered via php) is here Code: <div class="sidebar" id="sidebar-left"> <div id="navigation-secondary"> <ul class="links secondary-links"> <li class="menu-138 first"><a title="Link1 site" href="/link1">Link1</a></li> <li class="menu-139"><a title="Link2 site" href="/link1">Link2</a></li> <li class="menu-140 last"><a title="Link3 page" href="/link1">Link3</a></li> </ul> <div style="clear: both;"/> </div> I'd be glad if you could help me out. Thanks! Hi, I have a HTML page linking to a CSS file in the header. My main table is defined using class="formBody". This includes: Code: table.formBody td { border-width: 1px 1px 1px 1px; padding: 5px 5px 5px 5px; border-style: solid solid solid solid; border-color: black black black black; background-color: white; -moz-border-radius: 0px 0px 0px 0px; } I need to override this on certain cells, so that a SINGLE certain cell will not have any borders (these will be cells on the bottom row, so the table will have the appearance of having half of its' actual width on the bottom row). Any ideas? I tried explicitly setting border="0" in the <td> tag and also defining a new class called "noborder" with border set to none, and then using <td class="noborder"> but neither of these work. essentially, what I want, is a table that looks like: Code: ________________________ | | | | ------------------------ |________| Any suggestions on how to do this? Hey All, It's been a while, and my CSS knowledge is a bit rusty (not that it was ever all that;-). Anyway... Working on a custom wordpress admin write panel, I have a table with dynamic classes in a helper.css for indicating row status(includes .myclass tr:hover), which works great everywhere EXCEPT in our old friend IE6. Turns out that the wordpress "global.css" for admin panels defines the following: Code: html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,bi g, cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt ,dd, ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td { margin:0;padding:0;border:0;outline:0;background:transparent;} where, though I can't remember how I stumbled onto it, upon removing "background:transparent;" in wp admins global.css everything is hunky dory in IE6 too -- ok, not the tr :hover{ because IE6 only supports :hover on <a>s. but at least the row classes are displayed with no other discernible impact on this or any other admin pages in IE6 or any other browser. Of course, I don't want to go changing wordpress core code just to scratch my little itch, but I was hoping someone might suggest a means of overriding the background:transparent in wp admins global.css either in my own helper.css or in the on the page itself? I'd like to seperate blocks of text with a horazontal rule. I'd like it to be dashed. So, I've come up with this: Quote: hr { border: none 0; border-top: 1px dashed #000; width:98%; height: 1px } However, although this works well in IE, it Firefox there is too much space between the HR and the text block under it. In other words, the text above the HR comes right up to the line, but the text under the line, there is a larger gap. Any way to close the gap? Any ideas? Hello -- new to this forum. My questions concerns a problem I've run into many times. I'm trying to be CSS-moral and use style sheets as much as possible, or a least place properties in the Header. But here's what I run into. Many times I find it necessary to have different properties for the same tag within the Body. Currently, I use CSS to create the Menu items at the top of each web page, an Unordered List, using the "li" tags. Ok, but I just discovered that by using a new CSS statement, I can use custom bullets in the Body's li tag: list-style-image : url(bullet.gif) . Cool!!! So, I went about making a little dog bone .gif and used it for my bullet graphic halfway down the page. Voila! It worked. Voila! I suddenly have dog bones in my menu (which I don't want !), which also use the li tag. I only know two workarounds. 1) is to go back to the BAD practice of using the taboo in-line style="images/dogbone.gif" in each li within the body and NOT put the statement in the Header style section or 2) at least try to use CSS in the header by making a class like li.bone { list-style-image : bone} and then repeat class="bone" for each li in the body, which is only slightly shorter than just putting in the style="xxx" in the first place. So, how do we handle using different style properties for the same tag within the body? Perplexed, Mike Unfortunately I am not very experienced and I am trying to edit some coding that has been done for me. The code is as follows <div title="[[TITLE]]" style='background-image: url ([bg]); padding: 5%; width:90%; height:100%; padding-left: 6%; padding-right: 6%; background-size: 100% 100%; '> Now what happens is the words I type in this box are beautifully laid out because of the padding... The images placed in the box should stretch border to border - but obviously don't because of the padding.... Can anyone please tell me what I can change to give my text padding but images with no padding? Thanks so much What is the difference between inline styles and id's? Are there places where you should use one and not the other? Sorry if this has already been answered but I couldn't find anything in a search. |