CSS - Text Links And Hovers
Hello great forum you guys got here!
I am kinda new to CSS and need some help :S I have this link and I wrapped it with a plain simple box, but I also want the text to change from its default blue when I roll over it as well. Here is the CSS code Code: .navigation { width: 160px; height: 18px; padding:6px 6px; padding-left: 15px; margin-bottom:2px; font-size:10px; color: #333; background-color: transparent; display:block } .navigation:hover { background-color: #CCC; } I want it so that the color turns red upon hover! Regards & Thank you in advance! Similar TutorialsI am using the below script to hover a larger image of a photo, however when it hovers it appears underneath other content, how do I fix this. Thanks Tim PHP Code: .thumbnail{ position: relative; z-index: 0; } .thumbnail:hover{ background-color: transparent; z-index: 0; } .thumbnail span{ /*CSS for enlarged image*/ position: absolute; background-color: lightyellow; padding: 5px; left: -10px; top: -10px; border: 1px dashed gray; visibility: hidden; color: black; text-decoration: none; } .thumbnail span img{ /*CSS for enlarged image*/ border-width: 0; padding: 2px; } .thumbnail:hover span{ /*CSS for enlarged image on hover*/ visibility: visible; top: -250; left: 60px; /*position where enlarged image should offset horizontally */ } Hi everybody I'm sure many of you have come across the problem where your links jump when you increase font size or bold your text when you hover over them. The reason obviously being that the anchor is pushed bigger because the text content increases in size, thus pushing all following links around. I've solved this problem before for links on top of each other by defining a line height. My problem is specifically for links next to each other. I have solved this by placing each anchor inside a div and specifying a specific width for each. Although this works, it is not overly elegant. I was wondering if someone out there has a better solution to this? Thanks in advance. I have a map on an html page. If you mouseover "Savannah" the color of "Savannah" will change. The same will happen for "Broad". The problem is that the color doesn't change on "Broad" until you mouseover the top right part of "Broad". (Savannah and Broad are the only two that are active at this time.) You have seen this all over the web. I don't want to use Javascript. I want to do this using CSS. I do not have something quite right in my CSS. I have checked and checked and nothing stands out. I have looked at examples of Stu Nichols code similar to this, but I can't see anything. I thought it was a problem with the z-index, but nothing happens when I change the numbers. What am I doing wrong? Gayle CSS code: PHP Code: #imap { display: block; width: 801px; height: 677px; background: url(Images/RiverBasinMap_DENR.jpg) 0 0 no-repeat; position: relative; /*margin : 0 auto 2em auto; */ margin: 0 0; background-image: url(Images/RiverBasinMap_DENR.jpg); } #imap a { color: #000; font-family: arial, sans-serif; font-size: 1.2em; font-weight: bold; text-transform: uppercase; } a#title, a#title:visited { display: block; width: 801px; height: 0; padding-top : 260px; position : absolute; left: 0; top: 0; cursor: default; text-decoration: none; } * html a#title { height: 677px; height: 0; } #imap a#title:hover { background: transparent url(Images/RiverBasinMap_DENR.jpg) 0 0 no-repeat; overflow: visible; color: #c00; z-index: 10; } /*BROAD*/ a#broad { display:block; width:141px; height:159px; /*padding-top : 120px;*/ overflow:hidden; position: absolute; left: 285px; top: 295px; overflow: hidden; } * html a#broad { height: 159px; height: 0; } a#broad:hover { background: transparent url(images/Broad_Over.gif) no-repeat 0 0; overflow: visible; z-index: 21; } /*SAVANNAH*/ a#savannah { display: block; width: 181px; height: 313px; /*<!-- padding-top : 120px;-->*/ overflow: hidden; position: absolute; left: 226px; top: 318px; overflow: hidden; } * html a#savannah { height: 313px; height: 0; } a#savannah:hover { background: transparent url(images/Savannah_Over.gif) no-repeat 0 0; overflow: visible; z-index: 20; } HTML code: PHP Code: <body> <dl id="imap" name="imap"> <dt><a id="map" href="#nogo">Test Map</a></dt> <dd><a href="#" name="broad" title="Broad" id="broad"></a></dd> <dd><a href="#" name="savannah" title="Savannah" id="savannah"></a></dd> </dl> </body> Hi Folks, I've implemented a custom underline for all text links using background properties, but have found that my linked transparent PNG images are now affected with the underline as well. I've tried correcting this by applying background-image:none; to the affected PNGs -- I even used !important;. No luck. I also saw some mention of using the display:block; property to correct a similar problem. No luck. Suggestions? Thanks in advance! P.S. I was all set to post a link to a live example, but it seems new users can't post links? Hopefully the above description will suffice. Simple question, but i'm trying to create a decent sized space in between my links, and make them white. I can make my links white, but can't seem to change the space inbetween them. HTML Code: div id="bar-links"> <center> <div class="content box1"> <table width="500" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="4"><img src="images/barlist_01.gif" width="500" height="23" alt=""></td> </tr> <tr> <td background="images/barlist_02.gif" width="20"></td> <td background="images/barlist_03.gif" width="456"> </p> <div id="bar-links"> <h4><a href="#" title="Riley's Pub">Riley's Pub</a> <a href="#" title="Ho Down Bar"style="color: #fff">Ho Down Bar</a> <a href="#" title="Depot Square"style="color: #fff">Depot Square Bar</a> <a href="#" title="Egans Pub"style="color: #fff">Egans Pub</a> </h4> </div> </td> <td background="images/barlist_04.gif" width="24"></td> </tr> <tr> <td colspan="4"><img src="images/barlist_05.gif" width="500" height="27" alt=""></td> </tr> </table> </div> CSS Code: #bar-links { text-indent:inherit; text-align:left; } Good Morning All, Been having a slight problem with the visual in the screenshot below. The blue line is our H2, and the purple one is our H3, however, as you can see, the underline spans the entire width of the column, not just underneith the text, which is our requirement. ***As i am not allowed to upload a url as a new user, the underline is as follows. With the text centre aligned. text ----------------------------------------------------------- rather than text ------ and obviously by the css, the underline on the headers is a small image, repeated - x. Please see relevant css information. * (line 23) { margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; padding-top: 0pt; padding-right: 0pt; padding-bottom: 0pt; padding-left: 0pt; } h2, h3, h4, h5, h6 (line 101) { font-size: 1.2em; font-weight: normal; padding-bottom: 4px; margin-top: 0.6em; margin-right: 0pt; margin-bottom: 0.8em; margin-left: 0pt; text-align: center; } .contentArea h2, #secondaryNavigation h2 (line 114) { background-color: transparent; background-image: url("../images/h2_gradient_bg.gif"); background-repeat: repeat-x; background-attachment: scroll; background-position: left bottom; color: #0066cc; } Many Thanks in advance. Marc. I would like to pop up the text, that is, make it bigger when the user hovers on it. but the problem everytime the text gets bigger, the whole row moves and the surrounding texts gets displaced. any idea ? tutorial? let me know if i need to explain more. can someone help me with this? here is the page&css I have been working on... the page file the css file I might be silly to use a template that I did on illustrator (with all the banner, boxes and navbar read and just use that as my container background. then I made some transparent boxes for puting in text, images or form elements. Is that why I am not able to select any other those things on the site? this is the first time I try using css to make the whole webpage, so I would appreciate any guidance...thanks!! Hi, If I have the following CSS: body { margin: 0px; padding: 0px; } a:link, a:visited { color: #F36706; text-decoration: none; } a:hover, a:active { color: #F36706; text-decoration: underline overline; } #siteDimention { width: 758px; margin-left: auto; margin-right: auto; padding: 0px; } How come the links in my page aren't changing from the normal blue/purple ones? I have what seemed to be a simple idea but is turning out to bother me. In my style sheet i want to put a base url followed by a user id Link looks like this Code: http://mywebsite.com/this_folder/remote/html_server.php?xw_controller=hitlist&xw_action=set&target_id= Now in my html i have this Code: <table><tr><td >My name<td >Job position<td >606959150</tr> The last td that has the number in it i want to add to the end of the url posted above i cannot figure our what to put in the css to use as the main link and i want to add another td behind the last one with the number in it with the entirelink which should look like this Code: <a target="_blank" href="http://mywebsite.com/this_folder/remote/html_server.php?xw_controller=hitlist&xw_action=set&target_id=606959150">Link</a> I have to use this for multiple people each one using a unique ID# is there a simple way to do this, the reasoning behind this is that the main link changes once every few months, instead of changing all links i would like to be able to just change the one in the css file and be done with it. i hope i am explaining it correctly. Thanks ahead of time for any help u can provide I have set up a CSS file for a website I am building, however, when I click on the links which work correctly (at first) it goes to the desired place, if I go "back" the link turns to a larger italic font. Look here for example. http://www.burrellprolabs.com/newsite.htm if you click on one of the body copy links under "latestNEWS" then go back you will see what I mean. here is my css style for that particular part: .bodycopy { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #575757; text-decoration: none; line-height: 13px; } .bodycopy a:link { color: #BF0000; text-decoration: none; } .bodycopy a:active { color: #BF0000; text-decoration: none; } .bodycopy a:visited { color: #BF0000; text-decoration: none; } .bodycopy a:hover { color: #969696; text-decoration: underline; I'm currently working on a website for college, but I've run into an issue I can't work out. I can't seem to get rid of the default purple box that appears around my links. The HTML: Code: <div id="homelink"><a href="index.html"></a></div> The CSS: Code: #homelink{ position:absolute; width:53px; height:17px; margin-top:25px; margin-left:70px; z-index:10; } #homelink a{ display:block; background-image:url(images/links/home.png); background-repeat:no-repeat; width:53px; height:17px; } #homelink a:hover{ display:block; background-image:url(images/links/homehover.png); width:53px; height:17px; } As you can see, I use a background image for the div and no text for the link. Clicking the background image works fine and takes me to the homepage, however I get the default visited and active link border around it. Is there any way to solve this so that no border appears? I was messing around with <ul><li> type nav links, and had some issues with the bullet images I made were too large, so I made it as a background image for the <li> but <li> backgrounds didn't seem to work so well on IE. My question is this, why does everyone use <ul><li> to make their nav links when you can use less code just using <a>'s within a <div>? Here's my code example (bullet.jpg not included, it's just a 30px square I made in photoshop) Code: <html> <head> <style type="text/css"> #links li { text-indent:40px; list-style-type:none; } #links a { display:block; line-height:30px; height:30px; width:150px; background:#EEE url('bullet.jpg') no-repeat; } #links a:hover { background:#FFF url('bullet.jpg') no-repeat; } #links2 a { text-indent:40px; display:block; line-height:30px; height:30px; width:150px; background:#EEE url('bullet.jpg') no-repeat; } #links2 a:hover { background:#FFF url('bullet.jpg') no-repeat; } </style> </head> <body> <div id="links"> <ul> <li><a href="#">links</a></li> <li><a href="#">link 2</a></li> <li><a href="#">three</a></li> </ul> </div> <div id="links2"> <a href="#">links</a> <a href="#">link 2</a> <a href="#">three</a> </div> </div> </body> </html> I am not sure if these links count as navigation or not, so not sure if I should be using the UL element for semantic correctness? <div id="footer_bottom" class="bold"> <a href="sitemap.php" title="Sitemap">Sitemap</a> | <a href="accessibility.php" title="Accessibility Options">Accessibility Options</a> | <a href="http://validator.w3.org/check?uri=referer;verbose=1" rel="external" title="Validate XHTML">XHTML Valid</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer" rel="external" title="Validate CSS formatting">CSS Valid</a> </div> Hi, I have CSS document like so: Code: div.menu A:link { definitions } div.menu A:visited { definitions } div.menu A:active { definitions } div.menu A:hover { definitions } And in my HTML document Code: <div class="menu"> Links are then put in here </div> But only the first Link effect works, how come? I tried Google, got few results I were looking for, I know that the Link effects has to be in certain order, and in these websites I found they were in different order tried both but no luck Thanks alot! My first post Website:www.freewebs.com/weareamazing I can't figure out how to move the links that are at the top of my page (Home, Graphics, Icons, Linking Back, Credits) to the side of my table. I also want to get rid of that line that is under the links. Thank you for your help! I want to have a hover effect on the links of my page. I'm using an attached stylesheet to define it. Here is the section defining the links: Code: a:link { color: red; text-decoration: none; } a:hover { color: blue; text-decoration: underline; } a:visited { color: red; text-decoration: none; } a:active { color: red; text-decoration: underline; } Normal links appear red and is not underlined. When the cursor hovers over a normal link, it appears blue and is underlined. However, visited links do not 'behave' as normal links. They appear red and are not underlined. When hovered over, they do not change color or get underlined. I want visited links to act the same. They only way I could get them to act the same was to do the following: Code: a.general:link { color: red; text-decoration: none; } a.general:visited { color: red; } a.general:hover { color: blue; text-decoration: underline; } a.general:active { color: red; text-decoration: underline; } This is the only rules IE will obey. But every link need to be defined as instances of class "general". Is there a better way of handling this? question is about CSS and links. I can get underline effect, background change, etc by using .a but i need to have more than one sort of link in my page, e.g. menu links cannot have the same effect as links in the main text. How do i set up more than two link effects? |