[SOLVED] CSS Inserts
I am trying to change the color on a page. The page is div post-11, so says Firebug.
When I put this into CSS inserts, why doesn't it work? I am still having a hard time knowing how to format CSS in the CSS inserts correctly. Everything I put there is usually ignored. Yes, i save the additions I put in there. Code:
div#post-11 .post-11 page type-page hentry post odd Thank you |
That CSS is not correct. Reading Firebug and knowing which selectors to use does take a little getting used to. The way I suspect the code should be is as follows.
HTML Code:
div#post-11 {background-color:#b0c4de;} |
Quote:
|
try an !important
HTML Code:
div#post-11 {background-color:#b0c4de !important;} |
1 Attachment(s)
Using !Important did not affect the statement at all. I disabled the Ultimate TinyMCE plugin, but that didnt help. I copied the entire CSS path in firebug and put that in CSS Inserts, but no luck. I dont know why I have such a difficult time making CSS inserts work.
I exported my settings if you have time to take a look and see why my simple css statement to change to background color on a page will not work. Thanks... |
You capitalized !important. The i needs to be lower case.
|
Quote:
So it is selectors {background-color: #fff000 !important;} but it still does not work. There must be something ridiculously simple that I am overlooking. I'm running the site on a WAMP development server, but cannot see how that would make a difference.... |
if you are trying to change the PAGE background, you need to use
HTML Code:
body.page-id-11 {background-color: #b0c4de;} HTML Code:
div#post-11 .post-11 type-page type-page hentry post odd an html element of <odd> which is a child of an html element of <post> which is a child of an html element <hentry> which is a child of an html element <type-page> which is a child of an html element <type-page> which is a child of any html element that has a class of .post-11 that is a child of a <div> with a class of 'post-11' that just isn't going to work. You really need to take a tutorial on CSS ID's and Classes. there are some good ones at htmldog.com and w3schools.com/css. The periods and pound signs are very important.... |
body.page-id-11 {background-color: #b0c4de;}
That did not work either. I have been reading and studying CSS IDs and Classes for days. I'm sure you can never know enough - but I think the way CSS Inserts works adds another piece to the puzzle. Larry thought the line should perhaps read Code:
div#post-11 {background-color:#b0c4de;} Code:
div#post-11 {background-color:#b0c4de !important;} Code:
body.page-id-11 {background-color: #b0c4de;} I sure appreciate all of your input, though. I'll let you know what finally works.:) |
ok, lets look at this from the begining. you said
Quote:
the div with a class of post-11 is not the page but a small part of the page, the post. this would be a small part of the page and the CSS insert you said you used has a totaly invalid CSS Selector. If the CSS selector is invalid then the rule will never be applied. Larry then gave you the css to change the background for a post with a class of post-11, assuming from our example, that you wanted to change the post background (see not having teh URL to look at what you want to change, we have to make some assumptions) I suggested adding an !important because of the CSS selector precedence rules. It would caue this rule to be applied in case another rule was also being applied. Then you stated you are trying to change the background color of the page, which is why I told you to use the body.page-id-11.... css - something that I tested and it works. another issue could be that you are placing it at the end of your CSS inserts but you have a syntax error earlier which is causing all teh following css to be ignored. so remove all your css inserts except for my last suggestion and see what happens. But remember that we can only go by the information you give us, when there is misleading information, or a answer is given using the wrong termonology the results might not be what you expect. But keep working on it, if you can't show us the page, then attach a export of the settings ech time so we can look at whet you are actually doing. :) |
I just imported the setting you attached to a previous post and it shows the following on the last line
HTML Code:
html body.home div#wrapper div#container table#layout tbody tr#bodyrow td#middle div#post-11.post-11 { |
Thanks for being kind and patient in your reply; my frustration at not being able to conquer HTML/CSS/Wordpress/Firebug and web site building in general is getting the best of me.
Although I started out with specific elements in mind to color, it came down to wanting to see any or all of the page change color; I just wanted to see the CSS Insert work on something! I think Juggledad has hit the solution though. I am going to remove and save all of the CSS inserts except for the one I am working on. Larry, that long selector that I put in there was overkill - it was the CSS path on the element I inspected in Firebug - The div #11 in the td#middle. You are right - I am taking it out. Thanks again for sharing all of your expertise. Sharon |
Juggledad, you were right. I removed all of the code in CSS Inserts, ATA 3.7.3, leaving only the code to change the background-color, and it worked. So thank you to you and Larry for another valuable lesson in working with CSS Inserts in ATA Options. I wish I had thought of it myself, better luck next time. :o
|
All times are GMT -6. The time now is 09:49 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.