First let me say that this is only my second website build so please be patient with me. I am trying to change background images of some links using p:hover. I built a test page and everything worked the way I wanted it to, but when I cut a pasted the code from the test page to the actual page they no longer came through. Anybody have any thoughts?
here is my code the first one is the test page. The second and third are the actual page and the CSS that goes with it.
WEll links arent controlled by the p tag at all. You need to be using a:link a:hover a:visited and a:active. Those are what you are going to define in your css to style links. not p:link there is no such thing.
Also div.links {} is saying that you are creating a class called links. That is not saying you are styling the links themselves. http://www.w3schools.com/css/ Read this and go through them all. It will help alot
Last edited by PBSWebDesign; 04-22-2012 at 01:29 PM.
----------------------------------------------------------------------------------------------
WYSIWYG editors will never beat my hand written code!!!! Learn to do it in notepad and learn how to actually control your website! Current Project http://www.jmcanineservices.com
Yes, I understand that, but I am changing the background of the <p> containing the <a>
For what reason? Html and CSS dont provide a way to change the background of an element like that on hover. You need javascript for that. Only links that get hovered over can have the styles changed in CSS and HTML. Javascript would be able to change the entire p element on hover with the mouse.
----------------------------------------------------------------------------------------------
WYSIWYG editors will never beat my hand written code!!!! Learn to do it in notepad and learn how to actually control your website! Current Project http://www.jmcanineservices.com
The way you based your question above was that you wanted to only change the backgrounds of the links which is easy to do. But now you are saying you want to change the entire background of the p element that happens to hold the links and/or other text inside. I think once we find out exactly what you are wanting it will be easier to diagnose what you need to do.
----------------------------------------------------------------------------------------------
WYSIWYG editors will never beat my hand written code!!!! Learn to do it in notepad and learn how to actually control your website! Current Project http://www.jmcanineservices.com
At this point I think the hover part of this page is irrevelent. I'm not getting any background image in the <p> element on the actual page. It is working just fine on the test page. I have validated everything with W3C and tried IE7 IE8 and current release version of Chrome. All act the same.
Well if you are just wanting a background on just the p element then in css do
Code:
p {
background: url(path/to/image.jpg);
}
----------------------------------------------------------------------------------------------
WYSIWYG editors will never beat my hand written code!!!! Learn to do it in notepad and learn how to actually control your website! Current Project http://www.jmcanineservices.com
Send me the files so that I can clean up the code and take a look at all of the source. Send them as a zip to PBSWebDesign@gmail.com Thanks
----------------------------------------------------------------------------------------------
WYSIWYG editors will never beat my hand written code!!!! Learn to do it in notepad and learn how to actually control your website! Current Project http://www.jmcanineservices.com
----------------------------------------------------------------------------------------------
WYSIWYG editors will never beat my hand written code!!!! Learn to do it in notepad and learn how to actually control your website! Current Project http://www.jmcanineservices.com
That is exactly what I was want it to do. I will consider the PHP includes and the offer that you made me in your e-mail.
Can you tell me why it wasn't working the way I had it? Why did changing background-images { url("images/YellowBG.png"; } to background-image { url(".../images/YellowBG.png"; } fix the problem?
Bookmarks