Follow us on...
Follow us on Twitter Follow us on Facebook
Register
Page 1 of 4 1234 LastLast
Results 1 to 8 of 25
  1. #1
    Perseus's Avatar
    Perseus is offline Registered User
    Join Date
    Mar 2003
    Location
    Brooklyn, NY
    Posts
    446
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Need a CSS nav bar tutorial

    For some reason, I am unable to find a thorough and clean tutorial on how to create a CSS navigation bar. All I want is my bar to contain an "up" image and "rollover" image states, and when clicked, will link to another page.

    The tutorials have seen include complex ways to manipulate links and a:link, a:hover states etc, and I just dont understand it. Can anyone help me?
    PowerMac G4 | Dual 500 MHz | 640 RAM | OS 10.4.6 | CD-R/DVD-R | 64 VRAM
    PowerBook 100 | 4 RAM | OS 7.2

  2. #2
    bigdoug is offline Registered User
    Join Date
    Sep 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    a:link {color: black; text-decoration: none;}
    a:active{color:black; text-decoration: underline; }
    a:visited{ color:black; text-decoration: none;}
    a:hover {color:red; text-decoration:underline;}

    this will make a generic rollover with an underline on the text. if you want more help write back

  3. #3
    Perseus's Avatar
    Perseus is offline Registered User
    Join Date
    Mar 2003
    Location
    Brooklyn, NY
    Posts
    446
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Im asking for a navigation bar consisting of images that are buttons. There will be a normal state (one image) and the rollover state (second image). When clicked, you will be linked to another page. Thats all.
    PowerMac G4 | Dual 500 MHz | 640 RAM | OS 10.4.6 | CD-R/DVD-R | 64 VRAM
    PowerBook 100 | 4 RAM | OS 7.2

  4. #4
    Pengu's Avatar
    Pengu is offline Digital Music Pimp
    Join Date
    Nov 2002
    Location
    Um.. Here.
    Posts
    1,591
    Thanks
    0
    Thanked 0 Times in 0 Posts
    .buttonOne
    {
    backround-image: url(image.png);
    }

    .buttonOne:hover
    {
    background-image: url(imageOver.png);
    }
    PowerMac G5 Dual 2.0Ghz | 1Gb | 250Gb | Bluetooth | NVidia GeForce 6800 Ultra DDL 256Mb | 20" Cinema Display | MX1000 Wireless Laser Mouse | OS X 10.3.9

    PowerMac G4 400Mhz | 832Mb | 40Gb + 120Gb | OS X Server 10.3.8 - Web Dev, Proxy, Mail, NAT, Firewall, Backup

    Netgear Gigabit Switch | Sony Ericsson P910i Smartphone | iPod Colour 60Gb

  5. #5
    Pengu's Avatar
    Pengu is offline Digital Music Pimp
    Join Date
    Nov 2002
    Location
    Um.. Here.
    Posts
    1,591
    Thanks
    0
    Thanked 0 Times in 0 Posts
    check out this page. I've got a lot of stuff, but the buttons are in a seperate CSS file.

    http://pengu.uttx.net

    http://pengu.uttx.net/css/buttons.css
    PowerMac G5 Dual 2.0Ghz | 1Gb | 250Gb | Bluetooth | NVidia GeForce 6800 Ultra DDL 256Mb | 20" Cinema Display | MX1000 Wireless Laser Mouse | OS X 10.3.9

    PowerMac G4 400Mhz | 832Mb | 40Gb + 120Gb | OS X Server 10.3.8 - Web Dev, Proxy, Mail, NAT, Firewall, Backup

    Netgear Gigabit Switch | Sony Ericsson P910i Smartphone | iPod Colour 60Gb

  6. #6
    mdnky's Avatar
    mdnky is offline [Bobs/Prog/Design:~] mod%
    Join Date
    Jul 2001
    Location
    Baton Rouge, LA - USA
    Posts
    2,676
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Code:
    ------
    HTML
    ------
    
    <ul id="navlist">
         <li><a href="link.html" accesskey=" " title="Link Title Here">Link Text</a></li>
    <li><a href="link.html" accesskey=" " title="Link Title Here">Link Text</a></li>
    <li><a href="link.html" accesskey=" " title="Link Title Here">Link Text</a></li>
    <li><a href="link.html" accesskey=" " title="Link Title Here">Link Text</a></li>
    </ul>
    
    
    
    ------
    CSS
    ------
    
    #navlist {
         margin: 0;
         padding: 0;
         list-style: none;
         }
    
    #navlist li a:link, #navlist li a:visited {
         display: block;
         width: 100px;
         height: 30px;
         color: #c03;
         background: transparent url("imagename-normalstate.png") no-repeat top left;
         }
    
    #navlist li a:hover {
         color: #039;
         background: transparent url("imagename-overstate.png") no-repeat top left;
         }
    That's assuming you aren't putting the text of the link in the image (a big accessibility no-no). The above code should give you a basic vertical menu. If you need to adjust spacing between buttons, then add a #navlist li rule and use margin or padding as needed.

    To make it horizontal, use a #navlist li rule with display:block; float: left; or display: inline.

    If you don't want to mess with all that, or at lest the back and forth, post a mock-up of how you want the image to look on the page and a copy of the normal and over states for the buttons and I'll write it up for you.


    Good tutorial: http://www.listamatic.com
    .
    | My Homepage | Restore the Pledge |

    • MacBook Pro i7 2.66GHz 15" HD matte, 4GB, 500GB 7200RPM, OS X 10.6
    • MacBook Pro Core2Duo 2.33GHz 15" matte, 2GB DDR2 RAM, 500GB 7200RPM, DL Superdrive, OS X 10.6
    • Apple 23" Cinema HD Display, Apple Slim-Alum Keyboard, Apple BT Alum Keyboard, Magic Mouse
    • iPhone 4, iPhone 3G, iPhone 8GB, iPod Nano 16GB, iPod Photo 30GB, Nikon D50, Nikon L6, Epson 3490, Epson R1800, OkiData C5500N


  7. #7
    bigdoug is offline Registered User
    Join Date
    Sep 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Pengu
    .buttonOne
    {
    backround-image: url(image.png);
    }

    .buttonOne:hover
    {
    background-image: url(imageOver.png);
    }
    pengu...i've never seen this approach before. so do you just apply this class to a td and the images will show up in it?

    bigdoug

  8. #8
    Pengu's Avatar
    Pengu is offline Digital Music Pimp
    Join Date
    Nov 2002
    Location
    Um.. Here.
    Posts
    1,591
    Thanks
    0
    Thanked 0 Times in 0 Posts
    no. if you look at the site i posted (a work in progress) you'll see they're added to each HREF, with an index-transparent PNG inside, with a class set to width: 100%; height: 100%

    i forgot to add the dimensions to the classes above.
    PowerMac G5 Dual 2.0Ghz | 1Gb | 250Gb | Bluetooth | NVidia GeForce 6800 Ultra DDL 256Mb | 20" Cinema Display | MX1000 Wireless Laser Mouse | OS X 10.3.9

    PowerMac G4 400Mhz | 832Mb | 40Gb + 120Gb | OS X Server 10.3.8 - Web Dev, Proxy, Mail, NAT, Firewall, Backup

    Netgear Gigabit Switch | Sony Ericsson P910i Smartphone | iPod Colour 60Gb

 

 
Page 1 of 4 1234 LastLast

Similar Threads

  1. Safari - Multiple Bookmarks Bar
    By bobw in forum Apple News, Rumors & Discussion
    Replies: 2
    Last Post: January 19th, 2009, 04:03 AM
  2. Movable Type CSS problems (rebuild destroys CSS)
    By michaelsanford in forum Design & Media
    Replies: 0
    Last Post: December 20th, 2004, 09:36 AM
  3. steel-like tool bar and menu bar ?
    By copo in forum Mac OS X System & Mac Software
    Replies: 6
    Last Post: June 13th, 2003, 10:13 AM
  4. Window title bar moves behind OS menu bar.
    By Brooks in forum Mac OS X System & Mac Software
    Replies: 2
    Last Post: December 11th, 2002, 09:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •