CSS - How Can I Get Rid Of Link Decoration (images)
To emphasis a link I put a small image (its an "X") before the link. See attached picture.
GOOD this works well for text links: Code: <a href="...">text</a> ---> X text BAD I integrate a picture and define the picture as link Code: <a href="..."><img src="..."></a> ---> X <image> How can I avoid to show the X in front of the picture? Here is my CSS code: Code: #content a { background-image: url(images/arrow.gif); background-repeat: no-repeat; padding-left: 22px; text-decoration: none; color: #990000;} #content a:hover { text-decoration: underline;} Something like this does not solve the problem Code: 01 #content img a { background-image: none; } 02 #content img>a { background-image: none; } Any idea is greatly apreaciated. Thanks. Similar TutorialsPROBLEM: I create a nice button using the sliding doors technique for rounded corners. But the button displays with 100% width unless I float it. My layout requires that the buttons be inline with the text, so floating won't work. Anyone know an alternative? I wouldn't mind floating but I want the button to show inline with the text. When I use float:left, it removes it from the inline flow. Basically, I want a very modular button that can be used in several different places on a page. In many cases, floating is fine because the mockup has it out of the inline text, but I want to use it there, too. Here's the HTML: <a class="button" href="#"><span>Update Profile</span></a> Here's the css: a.button:link, a.button:visited { background:url(button_right.gif) no-repeat right top; } a.button span:hover, a.button span:active { background:url(button_left_hover.gif) no-repeat right top; } a.button span { background:url(button_left.gif) no-repeat left top; color:#fff; cursorointer; display:block; height:20px; line-height:20px; margin:0 2px 0 0; padding:0 10px; position:relative; white-space:nowrap; } I'm making my images links, but I keep getting the blue and purple links around the images. I have the text-decoration:none; everywhere I can think. What am I doing wrong. markrobinsondesign.com is my website so you can go and look at the source code. If you need me to post the code here let me know. Page coding: Code: <div class='btn'><div class='btntxt'><A HREF="#"><nobr>Harness in Art</nobr></A></div></div> <div class='btn'><div class='btntxt'><A HREF="#">Jewelry</A></div></div> <div class='btn'><div class='btntxt'><A HREF="#">Wearable</A></div></div> <div class='btn'><div class='btntxt'><A HREF="#">Decorative</A></div></div> <div class='btn'><div class='btntxt'><A HREF="#">Glass</A></div></div> <div class='btn'><div class='btntxt'><A HREF="#"><nobr>More Fun</A></nobr></div></div> CSS coding Code: .btn { float: left; width:80px; min-width:40px; max-width:129px; height: 42px; margin: 2px; padding: 3px 3px 2px 34px; border-bottom: 4px solid #<?= $basea->bg['-1'] ?>; border-left: 3px solid #<?= $basea->bg['+3'] ?>; border-right: 4px solid #<? echo $darka; ?>; border-top: 3px solid #<?= $basea->bg['+4'] ?>; background: #<?=$basea->bg['+2']; ?> url(images/LinkBtnTN.jpg) 0 0 no-repeat; } .btntxt { float: left; width: 100%; height: 100%; margin: 0; padding: 15px 0 0 0; } .btntxt a:link {color: #<?= $baseb->bg['+5'] ?>; text-decoration: none;} .btntxt a:hover {color: #<?= $basea->bg['+5'] ?>; text-decoration: none;} Ignore the embedded PHP, please. Why does the hover work and the a:link not? This is driving me nuts! Everything else rocks. Thanks. HeadElf I have: td.a1 { background-color: white; color: #003399; width: 120px; height: 30px; font-family: "MS Verdana", sans-serif; font-size: 25px; font-weight: bold; text-align:center; } how do I alter so I can hyperlink the text spanned by the above so that no usual underlines, change of color etc. occur when the text is hovered, clicked. The below added to the css above doesn't work... link text-decoration: none; visited text-decoration: none; active text-decoration: none; hover text-decoration: none ie: td.d0 { background-color: white; color: #003399; width: 120px; height: 30px; font-family: "MS Verdana", sans-serif; font-size: 25px; font-weight: bold; text-align:center; link text-decoration: none; visited text-decoration: none; active text-decoration: none; hover text-decoration: none } doesn't stop the underlining, change of color etc. hi, i would like the underline of my top level links to be as wide as the naviagtion box, it is currently only streching to the end of the text itself PHP Code: <ul> <li><a href="?action=abouUs">about us</a> <ul> <li><a href="?action=press">press</a></li> <li><a href="?action=tellFriend">tell a friend</a></li> <li><a href="?action=feedback">feedback</a></li> </ul> </li> <li><a href="?action=new">fitting room</a></li> <li><a href="?action=offers">best sellers</a></li> <li><a href="?action=col">useful info</a> <ul> <li><a href="?action=pay">payment options</a></li> <li><a href="?action=delCharge">delivery charges</a></li> <li><a href="?action=retPol">returns policy</a></li> </ul> </li> </ul> PHP Code: /* LEFT NAV */ #leftNav { color: #000; float: left; margin: 0; padding: 0; width: 128px; } #leftNav a { border-bottom: 1px solid #000; text-decoration: none; width: 120px; } #leftNav ul li ul a { border-bottom: none; } #leftNav ul { list-style: none; margin: 0; padding: 10px 0 0 10px; display: block; border: none; } #leftNav ul li { margin: 0; padding: 0 0 10px 0; width: 110px; font-size: 14px; font-weight: bold; } #leftNav ul li ul { margin: 0; padding: 5px 0 0 10px; } #leftNav ul li ul li { margin: 0; padding: 0; list-style: none; font-size: 12px; font-weight: 300; width: 95px; } /* END OF NAV */ thanks for your help Hello, more issues(!) I'm using "text-decoration: line-through" to cross out retail prices - catalogue style. The trouble is, when the effect is used with certain numbers like "8" and "3", the numbers become unreadable and it looks like we're charging more than the retail price on some products. My boss likes the effect, so I need to find out how to raise the height of the line-through. Does anyone know how I can do this, or any other methods (such as border control) that will be more effective. Many thanks! I am having an issue with my text decoration for a link in a unordered list not being declared correctly. I have set the href link to text-decoration: none value, but it is still getting the declaration from the #gt_links tag. Why isn't it picking up the #gt_links li a tag. here is the code: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>NONE</title> <style> #gt_links { position: relative; top: 139px; height:auto; width: 138px; margin: auto; font-size: 12px; font-weight:bold; color: #ffcc66; text-decoration: underline; // believe is culprit margin-top: 5px; } #gt_links li, ul { margin: 0; padding: 0; list-style: none; text-decoration:none; } #gt_links li a { display: inline; position: relative; font-size: 10px; font-weight: normal; text-decoration: none; color: #ffcc66; } #gt_links a { display: inline; position: relative; font-size: 10px; font-weight: normal; text-decoration: none; color: #ffcc66; } #gt_links a:hover{background:none;text-decoration:none;} #gt_links li:hover{background:url(http:/static.grepolis.com/images/game/layout/menu_hover.png)no-repeat;} </style> </head> <body> <div id="gt_links">Grepolis Tools <ul> <li><a id="w_pref" href="#">Preferences</a><span style="color:#FFCC66;"> | </span><a id="w_help" href="#">Help</a></li> <li><a id="w_toggle" href="#">Show/Hide</a></li> </ul> </div> </body> </html> Yes I know if you pull it up it is very ugly. This is just the part of a page which is relative to my issue. Please help. Thanks How do I remove the text decoration (make underline invisible) in table by CSS? text-decoration: none; cannot work in my CSS..... <style type="text/css"> table { font-family: Verdana; font-size: 12px; text-decoration: none; } </style> Not sure if I'm missing something or if there's a hack for FF (and possibly other browsers), but on hover, text-decoration:underline doesn't seem to work in FF. Here's the HTML: Code: <div class="prod_container"> <div class="leftprods"> <div style="text-align:center; margin:auto;"><a href="#"><img src="images/prod_ta.gif" style="border:0;" alt="Time and Attendance" /><div class="prod_text">Time and Attendance</div></a></div><div> </div> <div style="text-align:center; margin:auto;"><a href="#"><img src="images/prod_devkit.gif" style="border:0" alt="Development Kits" /><div class="prod_text">Development Kits</div></a></div> </div> <div class="rightprods"> <div style="text-align:center; margin:auto;"><a href="#"><img src="images/prod_access.gif" style="border:0" alt="Access Control" /><div class="prod_text">Access Control</div></a></div><div> </div> <div style="text-align:center; margin:auto;"><a href="#"><img src="images/prod_finger.gif" style="border:0" alt="Fingerprint Readers" /><div class="prod_text">Fingerprint Readers</div></a></div> </div> </div> Here's the CSS: Code: .leftprods { text-align:left; float:left; } .leftprods a{ text-decoration:none; color:green; } .rightprods { text-align:left; float:right; } .rightprods a{ text-decoration:none; color:green; } .prod_text { font-size:16px; color:green; font-weight:bold; padding-bottom:5px; } .prod_container a:hover { text-decoration:underline; } Thanks. Well I have images that I am using as link: Code: <dl class="links"> <dt><a href="index.html"><img class="border" src="images/home.gif" alt ="home" /></a></dt> <dt><a href="aboutme.html"><img class="border" src="images/aboutme.gif" alt ="About Me" /></a></dt> <dt><a href="blog.html"><img class="border" src="images/blog.gif" alt ="Blog" /></a></dt> <dt><a href="guestbook.html"><img class="border" src="images/guestbook.gif" alt ="Guestbook" /></a></dt> <dt><a href="tutorial.html"><img class="border" src="images/webtutorial.gif" alt ="Web Tutorial" /></a></dt> </dl> What I am trying to do is get this into the CSS of my page as I want to make multiple skins for the page. But I am at a loss of how to get the image name of the link into it, so that in different style sheets I can use different pictures. Please Help, Bumfluff I'm having some problems getting rid of the border which appears around an image when you turn it to a link. What I'm after happening is like on this forum, where it says new topic there's no blue border around it. I've looked at the source but can't figure out the bit that controls it, so if anyone could help it would be great. I am having a problem with some css image links not showing up in some browsers (IE 7, for example). Seems to work on most Mac browsers (of course!) Any help is appreciated! I've tried a few different things with the code, which explains the few items that are commented out. HTML: <a href="contact-form.php" class="more-info"><img src="images/spacer.gif" width="156" height="79" /></a> <a href="charity.php" class="community"><img src="images/spacer.gif" width="154" height="72" /></a> CSS: a.more-info:link { display:block; overflow:hidden; text-indent:-9999px; width:156px; height:79px; background:url(../images/more-info2.png) no-repeat 0 0; margin:6px 0 0 3px; } a.more-info:hover{ background-position: -156px; } a.community:link{ display:block; overflow:hidden; text-indent:-9999px; width:154px; height:72px; background:url(../images/community.png) no-repeat 0 0; margin:6px 0 0 3px; } a.community:hover{ background-position:-154px; } I use the following CSS for my links, and use a border-bottom to give them a dashed underline... Code: a { color: #AC4870; border-bottom: 1px dashed #DDDDDD; text-decoration: none; } a:hover { color: #DDDDDD; border-bottom: 1px dashed #AC4870; text-decoration: none; } This underline also shows up under my images that are used as links. How would you write CSS that would remove this dashed border-bottom from my image links? Thanks Here is another question. Is there an easy way to excluded images from displaying the link properties I've specified in the stylesheet? Basically on hover the links get a background color and underline. But I also have images that are link that I don't want to do that too. Here is the site. You can see what's happening on the images towards the bottom. Let me know if posting the code would be easier. Thanks. http://tinyurl.com/5llwfl I'm having some problems with this page in particular. Try clicking on one of the Left or Right white image arrows below the main picture. This only occurs in Firefox 2.x. Once you click the link, the content area below "Starting from $278.497" should shift roughly 5 pixels down. I thought it may be related to the dotted link outline that surrounds the image, but that was not the case. I applied styles to get rid of that and there was no changes. I also thought it may be related to a position:relative; bug which this site has been notorious for. I tried making certain divs in that area position:relative to no avail. So to test further I tried an overall #content *{position:relative;} fix which could not fix the position shift, either. I'm not sure what else it could be. And while I do have access to the build of this app, I have not been able to reproduce the issue by downloading all HTML, CSS, and image files locally. Hello Is there a way i can restore my <a href> link back to its original color, that is before the a:visited event, when I click on another link? PS. no Javascript code needed, is their an alternative in css? I have my links defined with a dashed border, but I don't want this on linked images and I'm trying to figure out if I can accomplish this with CSS only without additional markup in my HTML file. Here is a sample file: http://www. shawkey.com/test/imagebordertest.html Any suggestions on how I can get the dashed border to not appear below the image and only appear below the text with just CSS? Hello is there a way to make it so hyperlinks are not decorated as the default blue? I have the following css which I've attempted to make it so the text '.com' is always white, but it defaults to the standard link color. html: <td class="nodecoration"><a class="nodecoration" href="http://www.somesite.com">.com</a></td> css: Code: td.nodecoration { background-color: #003399; color: white; width: 120px; height: 30px; font-family: "Verdana", sans-serif; font-size: 25px; font-weight: bold; text-align:center; } A:link.nodecoration {text-decoration: none} A:visited.nodecoration{text-decoration:none} A:active.nodecoration{text-decoration:none} a:hover.nodecoration{text-decoration:underline} Im just curious, what are the advantages of using css to import all your images (that arnt dynamic) as apposed to inserting them into your html using the <img> tag? i can only find the script to show background images in a css style sheet..but how would I go about for example showing an image not as background? i have style switcher, but I'm wanting to use buttons aswell for example blue.gif and red.gif using 2 different styles. how would I show the image in css?, which I can also put a link on maybe in the html or css? HElP! thanks |