Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Best way to make this fireworks nav into CSS?

    hi
    im still new to css etc but have some basic skills.

    Im waniting to make this image into a working navigation.


    Basically its just text with a font i downloaded and added a background as you can see.

    What would be the best way guys?


    many thanks

  • #2
    Regular Coder najkiie's Avatar
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    103
    Thanks
    7
    Thanked 0 Times in 0 Posts
    You could use Photoshop so slice it up to several items, and then just add the different menu images to your website and link them up.

    -Nike
    -Nike - PTS - Blubbz
    I would love to change the world, but they won't give me the source code.

  • #3
    Regular Coder
    Join Date
    May 2008
    Posts
    135
    Thanks
    13
    Thanked 10 Times in 10 Posts
    you could use it as a sprite.

    so say each button is 100px wide

    have 5 buttons (home,cars,contact,search,about)

    then for each button set its background image to the sprite image

    and use the background position to position the text for each button.

    i.e

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style>
    #home {
    	background-image: YOUR IMAGE URL;
    	height: 40px;
    	width: 100px;
    	display: block;
    	background-repeat: no-repeat;
    }
    #cars{
    	background-image: YOUR IMAGE URL;
    	height: 40px;
    	width: 100px;
    	display: block;
    	background-repeat: no-repeat;
    	background-position: -100px;
    }
    </style>
    
    </head>
    
    <body>
    
    <a id="home" href="#">Home</a>
    <a id="cars" href="#">Home</a>
    </body>
    </html>
    this saves you slicing it up, and saves you loading 5 images when you can just load 1.

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello zerox,
    With a little editing this code could be adapted to your image - http://nopeople.com/CSS/css%20rollov...age/index.html

    That is a single image that makes all 6 buttons, the hovered buttons and the current page indicator.
    View the source to see how it's done.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #5
    Regular Coder
    Join Date
    Nov 2005
    Posts
    329
    Thanks
    3
    Thanked 19 Times in 19 Posts
    Another way of doing it is to place all the links in a div bar which has the background image. To get the red stroke between the links the last link would have to be coded separately, so the ul solution is not practical. Try this:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
    <html>
    
    	<head>
    		<title>navbar</title>
    		<style type="text/css">
    		#mynavbar {width: 610px; height: 25px; background-color: #3a3a3a; background-image:url(myimage.jpg); text-align:center; padding:3px;}
    		#mynavlink1,#mynavlink2, #mynavlink3, #mynavlink4 {float:left; clear:right; width: 120px; border-right: 1px solid #FF0000; color:#FF0000; line-height: 25px; font-size: 20px;}
    		#mynavlink5 {float: right; width: 120px; text-align:center; color:#FF0000; font-size: 20px; line-height: 25px;}
    		a:link {font-family: calibri; color:#FF0000; font-size: 20px; text-decoration: none;}
    		
    		</style>
    	</head>
    	<body>
    <div id="mynavbar">
    
    <div id="mynavlink1"><a href="homepage.html">home</a></div>
    <div id="mynavlink2"><a href="cars.htlm">cars</a></div>
    <div id="mynavlink3"><a href="contact.html">contact</a></div>
    <div id="mynavlink4"><a href="search.html">search</a></div>
    <div id="mynavlink5"><a href="about.html">about</a></div>
    
    </div>
    
    	</body>
    </html>
    Adjust size, font, etc. to suit your wishes and don't forget that the links, being text, will show only if the same font is available on the viewer's browser. Text is better for search-engines, but if you absolutely want to use the font in your example, you would have to convert it to an image map.

    Also, I've done this on a Mac (Safari, FireFox) , and hope a PC will render it correctly

    Cheers!


  •  

    Posting Permissions

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