Connecting Tech Pros Worldwide Help | Site Map

Image Links Surrounded By Background....

Newbie
 
Join Date: Sep 2008
Posts: 4
#1: Sep 6 '08
I have coded my css so that my text links have a background and border which I want to keep but I cant seem to edit the css so that my image links dont have the same thing....

http://www.teenagedq.forever-in-love.org/blends.php

If you click on the link that says leonardo dicaprio the java script will come up that shows the blend but the close button on the java script is surrounded by the same background and border as my text links... is there a code I need to put in my css to stop this happening ?

The navigation part of my css looks like this if it helps .... (the numbers are not a part of the css)

Expand|Select|Wrap|Line Numbers
  1.  
  2. #navigation {
  3. margin: 0;
  4. padding: 0;
  5. list-style-type: none;}
  6.  
  7. #navigation li {
  8. margin-bottom: 2px;}
  9.  
  10. #navigation a, a:link, a:active, a:visited {
  11. background: #ff99cc;
  12. color: #cc0066;
  13. display: block;
  14. border-bottom: 1px solid #cc0066;
  15. border-left: 5px solid #cc0066;
  16. border-right: 5px solid #cc0066;
  17. width: 208px;
  18. padding-left: 10px;
  19. text-align:left;}
  20.  
  21.  
  22. #navigation a:hover {
  23. background: #cc0066;
  24. color: #ff99cc;
  25. text-decoration: none;
  26. border-left: 5px solid #ff99cc;
  27. border-right: 5px solid #ff99cc;
  28. padding-left: 10px;
  29. }  
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,641
#2: Sep 6 '08

re: Image Links Surrounded By Background....


try
Expand|Select|Wrap|Line Numbers
  1. #navigation a, #navigation a:link, #navigation a:active, #navigation a:visited { /* line 9 */
you defined the style for all links with :link, :active, and :visited (not only the ones for navigation).

regards
Newbie
 
Join Date: Sep 2008
Posts: 4
#3: Sep 6 '08

re: Image Links Surrounded By Background....


Quote:

Originally Posted by Dormilich

try

Expand|Select|Wrap|Line Numbers
  1. #navigation a, #navigation a:link, #navigation a:active, #navigation a:visited { /* line 9 */
you defined the style for all links with :link, :active, and :visited (not only the ones for navigation).

regards


that takes the box away on the text links aswell...
is there any sort of code that makes a rule for images like the
a:link, a: active, a:visited like a a:img where you set the preferences for image links ?
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,641
#4: Sep 6 '08

re: Image Links Surrounded By Background....


Quote:

Originally Posted by EmmaEliza

that takes the box away on the text links aswell...
is there any sort of code that makes a rule for images like the
a:link, a: active, a:visited like a a:img where you set the preferences for image links ?

two possibilities:
1) extend the style to the content div
Expand|Select|Wrap|Line Numbers
  1. #navigation a, #navigation a:link, #navigation a:active, #navigation a:visited, #content a, #content a:link, #content a:active, #content a:visited { /* line 9 */
2) or define the lightbox link like you want it to be (id of the anchor is bottomNavClose)
Expand|Select|Wrap|Line Numbers
  1. #bottomNavClose, #bottomNavClose:visited, #bottomNavClose:link, #bottomNavClose:active, #bottomNavClose:hover {
  2.   /* your definitions here */
  3. }
regards
Newbie
 
Join Date: Sep 2008
Posts: 4
#5: Sep 6 '08

re: Image Links Surrounded By Background....


I tried the 2nd one first as it looked easier and it worked I think or it just covered the pink thing up =], what do I do for it to work with other images ?
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,641
#6: Sep 6 '08

re: Image Links Surrounded By Background....


Quote:

Originally Posted by EmmaEliza

what do I do for it to work with other images ?

shortly, the first option. to make it not too crowded apply it not to every id but to a class and attach the class everywhere you want the links styled in pink.

regards
Reply


Similar HTML / CSS bytes