Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 10 of 10
  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    20
    Member #
    26643
    Hello, thank you in advance for answering another beginner question of mine. I am trying to format the visited links on my site. I have used the following:

    #deptlinks a:visited {color: white;
    font-size: 8pt;
    text-decoration: none;}

    The color is working, but the font size is not changed and the underline is not gone. Why?

  2.  

  3. #2
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    I think your problem may have to do with where in the CSS your code is placed. CSS is read from the top down and so if there is anything below that indicates font-size or text-decoration, that will over write it. Can you post alink to the site in question? I would be better able to tell how to fix this if I could see the whole source.

    Cheers,
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  4. #3
    Junior Member
    Join Date
    Feb 2011
    Posts
    20
    Member #
    26643
    The site is not up online yet. I am just beginning to learn how to build this, I am mostly just practicing to try to get the hang of this. Here is the entirety of the code for what I have so far:

    html:

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtmll/DTD/xhtmll-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    <head>
    <title>Regen Group Home Page</title>
    <link rel="stylesheet" href="styles.css" type="text/css" />
    <style type="text/css">
    </style>
    </head>
    
    <body>
    <div id="banner"><img src='images/regen_logo.gif' /><h1>Lehigh University</h1></div>
    	
    <div id="deptlinks">
    <a href="http://www.lehigh.edu">Lehigh University</a> <a href="http://cas.lehigh.edu/casweb/default.aspx?id=449">Department of Chemistry</a></div>
    
    </body>
    
    </html>
    css:
    Code:
    body	{
    	background-image: url(images/bkg.jpg);
    	background-repeat: repeat-y;
    	width: 100%}
    
    #banner	{
    	background-color: #502d0e;
    	height: 70px;
    	width: 100%;
    	position: absolute;
    	top: 0;
    	left: 0;}
    	
    #banner h1 {
    	display: none;}
    
    #deptlinks {
    	position: absolute;
    	top: 70px;
    	left: 0px;
    	width: 100%;
    	background-color: #502d0e;
    	padding-left: 200px;}
    	
    #deptlinks a:visited {
    	color: white;
    	font-size: 8pt;
    	text-decoration: none;}

  5. #4
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    [CODE]<head> <title>Regen Group Home Page</title> <link rel="stylesheet" href="styles.css" type="text/css" />
    <style type="text/css"></style> </head>[CODE]

    You can get rid of the part of your code underlined in red, it's not doing anything.

    I checked your code and it is working - you have just chosen a font size that doesn't show a difference from the default.
    Try it with a font size of 18pt and see what happens.

    Also - just a note here - read up on font size in CSS and see if you might not prefer to go with em instead of pt for your sizing.

    Cheers,
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  6. #5
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Try div#deptlinks instead of just #deptlinks. I've seen things fixed using nothing but that.

    Apply it to both your #deptlinks and your #deptlinks a:visited.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  7. #6
    Junior Member
    Join Date
    Feb 2011
    Posts
    20
    Member #
    26643
    Quote Originally Posted by AlphaMare View Post

    You can get rid of the part of your code underlined in red, it's not doing anything.
    If I intend later on to have internal CSS as well as the external style sheet, I will need this line, correct?

    Quote Originally Posted by AlphaMare View Post
    I checked your code and it is working - you have just chosen a font size that doesn't show a difference from the default.
    Try it with a font size of 18pt and see what happens.
    That is not the problem, it is not working for me regardless of the font size, and it is not making the underline go away. I have noticed, however, that it is working in Internet Explorer for one of the two links only and not at all in Chrome.

  8. #7
    Senior Member Dorky's Avatar
    Join Date
    Jun 2009
    Location
    Destin Florida
    Posts
    1,430
    Member #
    19103
    Liked
    4 times
    delete your browser cache. close your browser. open your browser. load the page. linked styles do not load unless it is not yet cached. that mean unless your browser feels dandy, it's going to keep loading the old css. or just reload or refresh by right clicking and selecting from that menu.

    while($get_it !== true){ continue; }

  9. #8
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    If worse comes to worst, and this is basically last-resort stuff, you can always add "important" to the end of your attribute.
    Code:
    font-size:  0.5em !important;
    It's just not a good practice to get into because it makes code bulkier than it should need to be.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  10. #9
    Junior Member deanographics's Avatar
    Join Date
    Feb 2011
    Posts
    26
    Member #
    26637
    I actually learned this the other day css for links HAS TO BE THIS WAY and IN THIS ORDER

    a:link {color:#FF0000;} /* unvisited link */
    a:visited {color:#00FF00;} /* visited link */
    a:hover {color:#FF00FF;} /* mouse over link */
    a:active {color:#0000FF;} /* selected link */

    If you follow this you should have no issue you can further consult

    CSS Pseudo-classes

  11. #10
    Junior Member
    Join Date
    Feb 2011
    Posts
    20
    Member #
    26643
    I think the browser cache must have been the issue, everything looks fine now.

    I'm glad to see my CSS was actually right for once this time!

    Thank you all so much for the help. You guys are lifesavers for someone just trying to learn CSS for the first time!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:57 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com