ilikephp Posted July 1, 2008 Share Posted July 1, 2008 hi, I have this .css style: A:link { COLOR: #ffffff; TEXT-DECORATION: none } A:visited { COLOR: #ffffff; TEXT-DECORATION: none } A:hover { COLOR: #ffffff; TEXT-DECORATION: underline } A:active { COLOR: #ffffff; TEXT-DECORATION: none } how can I let the color be the same as my text, so for example: some paragraphs are in white, and some in blue. and I need the hyperlink to be in white or in blue as my text. how can we do it plz? Note: When I dont put a color for the css style, the default is the blue one. Thx... Quote Link to comment https://forums.phpfreaks.com/topic/112729-solved-hyperlink-style/ Share on other sites More sharing options...
dannyb785 Posted July 1, 2008 Share Posted July 1, 2008 if you want different colored links for different paragraphs, do something like the following: <style type="text/css"> p.bluestuff { color:blue; } p.bluestuff a { color:blue; } p.whitestuff { color:white; } p.whitestuff a { color:white; } </style> ... <body> <p class="bluestuff">text and links here will be blue</p> <p class="whitestuff">same here except they will all be white</p> you'll need to add "text-decoration:none;" in the link modifier if you want the links to blend in perfectly with text. I will end this by saying I highly recommend against coloring the text the same as the links. Unless you have a special reason. Quote Link to comment https://forums.phpfreaks.com/topic/112729-solved-hyperlink-style/#findComment-578916 Share on other sites More sharing options...
ilikephp Posted July 1, 2008 Author Share Posted July 1, 2008 Thx for the reply what is the differnce plz between: p.bluestuff { color:blue; } p.bluestuff a { color:blue; } Quote Link to comment https://forums.phpfreaks.com/topic/112729-solved-hyperlink-style/#findComment-578966 Share on other sites More sharing options...
dannyb785 Posted July 1, 2008 Share Posted July 1, 2008 the part without the "a" colors the text(and anything else that doesnt already have a specified color. and the "a" part colors the link. Think of it like a html tag. If it was a b instead of an a, then all bolds(since the tag is < b > ) would be that color. Quote Link to comment https://forums.phpfreaks.com/topic/112729-solved-hyperlink-style/#findComment-578970 Share on other sites More sharing options...
ilikephp Posted July 1, 2008 Author Share Posted July 1, 2008 thxx (Y) I use different colors with the links because I have different backgrounds, in frontpage, we can put all the hyperlinks to take the color: Automatic, can we do it in dreamweaver? Quote Link to comment https://forums.phpfreaks.com/topic/112729-solved-hyperlink-style/#findComment-578985 Share on other sites More sharing options...
dannyb785 Posted July 1, 2008 Share Posted July 1, 2008 Don't use either. You'll never learn if you have things doing the code for you. I've never used any of those programs and I do just fine. Quote Link to comment https://forums.phpfreaks.com/topic/112729-solved-hyperlink-style/#findComment-578987 Share on other sites More sharing options...
ilikephp Posted July 8, 2008 Author Share Posted July 8, 2008 can I merge the 2 functions into 1 function only? p.whitestuff { color:white; } p.whitestuff a { color:white; } Quote Link to comment https://forums.phpfreaks.com/topic/112729-solved-hyperlink-style/#findComment-584598 Share on other sites More sharing options...
dannyb785 Posted July 8, 2008 Share Posted July 8, 2008 no, because when you don't specify a tag(i.e. not having the a, or a h1, or anything after the class/id name), the color property applies to the text color only(links are not affected). But when you have the a after the class/id name, the color property affects only all thinks within and <a> tag. Quote Link to comment https://forums.phpfreaks.com/topic/112729-solved-hyperlink-style/#findComment-584650 Share on other sites More sharing options...
ilikephp Posted July 8, 2008 Author Share Posted July 8, 2008 so it's not wrong to put after each function p.whitestuff a { color:white; } p.redstuff a { color:red; } and so on... it depends on the color? Thx... Quote Link to comment https://forums.phpfreaks.com/topic/112729-solved-hyperlink-style/#findComment-584666 Share on other sites More sharing options...
dannyb785 Posted July 8, 2008 Share Posted July 8, 2008 not wrong to put what after the function? And it's not a function, it's best to not call it that. I'd call it a tag modifier, even though it modifies more than just tags(I know it has an official name, I forgot it). But anyway, what you have posted there will only change the color of the links. Think of what you're saying in that style code. You're saying that everything within a p tag that has a class of redstuff(or whitestuff) that is within an a tag will have the "color" color. So it literally, and flat out wotag modifier Quote Link to comment https://forums.phpfreaks.com/topic/112729-solved-hyperlink-style/#findComment-584707 Share on other sites More sharing options...
ilikephp Posted July 9, 2008 Author Share Posted July 9, 2008 Thx a lot... (Y) Quote Link to comment https://forums.phpfreaks.com/topic/112729-solved-hyperlink-style/#findComment-585094 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.