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 6 of 6
  1. #1
    Senior Member kirman's Avatar
    Join Date
    May 2003
    Location
    UK England
    Posts
    765
    Member #
    1499
    Liked
    2 times
    Hello all,

    I've just built this web site for a small gardening firm near where i live. Its far from finished i havent even put style sheets in yet lol

    But i like to tidy it all up in a oner but before i can do that i have a slight issue with the navigation buttons.

    In internet explorer they dont display how id like them too, they currently have a gap underneith them of about 1px. If i change the height of the button using the padding in the code below...

    ul li a {
    display: block;
    width:8em;
    padding: 7px 0px 6px 0px;
    text-decoration: none;
    color: #FFFFFF;
    background: #56791c;
    margin-left: 0px;
    white-space: nowrap;
    text-align:center;
    }

    IT displays perfect, but then the problem shifts over to firefox... i cant seem to find a medium. lol Any ideas?


    Oh and how can i change the color of the buttons once visited? Just so users know which page their on.

    Thanks again.

    kirman

    www.swiftpixel.co.uk/redwood

    ps i think ive just done it by adding height to the class above... but the colour problem with visited buttons im still unsure of..

    cheers
    Dream like you'll live forever. Live like you're gonna die 2morrow!

  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Browsers define margins and padding based on their default settings ( which are all slightly different ), if you don't define them.

    You have only defined the margin of 1 side of the block... Set to margin:0; sets the margin on all sides to zero...

    Also, don't mix your sizing... Choose either em or px, unless you're doing some creative math, and know exactly the difference between em and px sizing... Then you shouldn't mix them...

  4. #3
    Senior Member kirman's Avatar
    Join Date
    May 2003
    Location
    UK England
    Posts
    765
    Member #
    1499
    Liked
    2 times
    what about the link problem... so users can tell where they are? I must be able to add something to it so the users know where they are? just like links when visited go say the standard purple (i think lol)

    cheers for the reply
    Dream like you'll live forever. Live like you're gonna die 2morrow!

  5. #4
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    ul li a:hover { background-color: white; color:black;text-decoration:underline;}

    You only need to define what changes on a pseudo ... It inherits all other aspects from the parent.

  6. #5
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    You can also add a line-height property to your links to get rid of any gaps sometimes. line-height: 1.4em (or however high your menu is).
    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
    Senior Member Andrew Yurlov's Avatar
    Join Date
    Apr 2011
    Location
    Portland, OR
    Posts
    1,306
    Member #
    27566
    Liked
    181 times
    So you want the page the user is currently on for that navigation link to be a different color?

    EDIT: All you do is put a class on the respective link on each page. So for example...

    index page
    Code:
    <ul id="main-nav">
    <li><a href="test4.html">Test4</a></li>
    <li><a href="test3.html">Test3</a></li>
    <li><a href="test2.html">Test2</a> </li>
    <li><a href="test.html" class="special">Test1</a></li>
    </ul>
    next page
    Code:
    <ul id="main-nav">
    <li><a href="test4.html">Test4</a></li>
    <li><a href="test3.html">Test3</a></li>
    <li><a href="test2.html" class="special">Test2</a> </li>
    <li><a href="test.html">Test1</a></li>
    </ul>
    (notice how I put the class="special" tag only on the page I was currently on)
    Now all you have to do is code the css for this.

    Code:
    #main-nav a.special{
    opacity: 0.6;
    }
    I made a live example for you to see just to make sure you understand what im talking about.
    http://wagdesigns.webuda.com/test/test.html
    Artificial intelligence is nothing compared to natural stupidity -Someone

    Design is a funny word. Some people think design means how it looks.
    But of course, if you dig deeper, itís really how it works.
    -Steve Jobs




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 03:19 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com