March 16, 201214 yr So i'm making a layout in photoshop and want to use the navbar i have attached in the picture... I've thought about every which way to code it inside of a div, but dont know which would be the proper way. Ive thought of... - Setting is as one image and mapping the links with a client side image map - slicing is into individual links and setting the individually sliced images as seperate links - taking the background and using it as the div background (repeat-x) and then making a horizontal unordered list to make up the links. How would you code it? Your advise would be fantastic Big thanks
March 16, 201214 yr Simply UL and LI items wrapped within a div... <div id="navbar"> <ul class="navigationbar"> <li class="navigationitem"> <a href="xxx" class="itemlink">Text here<br/>Second line here</a> </li> <li class="navigationitem"> <a href="xxx" class="itemlink">Text here<br/>Second line here</a> </li> <li class="navigationitem"> <a href="xxx" class="itemlink">Text here<br/>Second line here</a> </li> </ul> </div> I would then use CSS to style each element. With regards to custom fonts, check out google fonts or other similar websites. Background imagery is simple to reproduce within either the DIV or the UL. Personally, I would apply a background image to the UL... meaning the DIV can then be repositioned, resized, padded...etc.. without major worries. That would be my chosen method... however recently, more and more I've seen websites using image based nav bars with "link mapping" over the images! Grrrrrrrrrrrrr Edited March 16, 201214 yr by AlexsDesign
March 16, 201214 yr Simply UL and LI items wrapped within a div... <div id="navbar"> <ul class="navigationbar"> <li class="navigationitem"> <a href="xxx" class="itemlink">Text here<br/>Second line here</a> </li> <li class="navigationitem"> <a href="xxx" class="itemlink">Text here<br/>Second line here</a> </li> <li class="navigationitem"> <a href="xxx" class="itemlink">Text here<br/>Second line here</a> </li> </ul> </div> I would then use CSS to style each element. With regards to custom fonts, check out google fonts or other similar websites. Background imagery is simple to reproduce within either the DIV or the UL. Personally, I would apply a background image to the UL... meaning the DIV can then be repositioned, resized, padded...etc.. without major worries. That would be my chosen method... however recently, more and more I've seen websites using image based nav bars with "link mapping" over the images! Grrrrrrrrrrrrr He could also use css sprite technique on the unordered list. It's quite ok way of doing it, with downside of having to off-set the actual text behind the frame. http://www.alistapart.com/articles/sprites2 This could be one way of doing it, Kirk.
March 16, 201214 yr Author Simply UL and LI items wrapped within a div... <div id="navbar"> <ul class="navigationbar"> <li class="navigationitem"> <a href="xxx" class="itemlink">Text here<br/>Second line here</a> </li> <li class="navigationitem"> <a href="xxx" class="itemlink">Text here<br/>Second line here</a> </li> <li class="navigationitem"> <a href="xxx" class="itemlink">Text here<br/>Second line here</a> </li> </ul> </div> I would then use CSS to style each element. With regards to custom fonts, check out google fonts or other similar websites. Background imagery is simple to reproduce within either the DIV or the UL. Personally, I would apply a background image to the UL... meaning the DIV can then be repositioned, resized, padded...etc.. without major worries. That would be my chosen method... however recently, more and more I've seen websites using image based nav bars with "link mapping" over the images! Grrrrrrrrrrrrr Okay, this is what I originally thought would be the best way to do it! It seems a heck of a lot of others do it this way, I'm still trying to work out how to code the CSS, how do i put a space between the links so they're not all bunched up together in a row!??! Thank you
March 17, 201214 yr Okay, this is what I originally thought would be the best way to do it! It seems a heck of a lot of others do it this way, I'm still trying to work out how to code the CSS, how do i put a space between the links so they're not all bunched up together in a row!??! AlexsDesign said use CSS for each element. .navigationitem { float: left; padding: 0 15px; } That will place the li tags on the same line with 30px (2*15px) between them. You will need more CSS to fine tune the navbar.
March 17, 201214 yr Author AlexsDesign said use CSS for each element. .navigationitem { float: left; padding: 0 15px; } That will place the li tags on the same line with 30px (2*15px) between them. You will need more CSS to fine tune the navbar. Thank you, so how come when you right 15px it gives you thirty?
March 17, 201214 yr Every li tag has 15px padding at each side, so it will give you 15px padding at the left and right ends but twice 15px between each li tag. If you want a different padding at the left or right ends, give those li tags an extra class with a different padding-left or padding right.
March 17, 201214 yr Author Every li tag has 15px padding at each side, so it will give you 15px padding at the left and right ends but twice 15px between each li tag. If you want a different padding at the left or right ends, give those li tags an extra class with a different padding-left or padding right. Ohhh right, so it adds the padding both sides, that makes sense now! Cheers
March 17, 201214 yr If you can, use CSS instead of images. In this case, I'd be curious about the font. Do you plan to use it across the whole site? If so, consider using font-face. This allows you to load the font into your webpage and use it for text. You'd then use CSS to make the nav, and use your font as the font-family for the links. I don't have your font, but I rustled this up in five min: http://jsfiddle.net/2tVL8/1/ Used Alexsdesign markup, although slightly adjusted. Look ma, no images! Edited March 17, 201214 yr by brightonmike
March 17, 201214 yr Author If you can, use CSS instead of images. In this case, I'd be curious about the font. Do you plan to use it across the whole site? If so, consider using font-face. This allows you to load the font into your webpage and use it for text. You'd then use CSS to make the nav, and use your font as the font-family for the links. I don't have your font, but I rustled this up in five min: http://jsfiddle.net/2tVL8/1/ Used Alexsdesign markup, although slightly adjusted. Look ma, no images! Thats excellent, its what im trying to create, but with the font 'Bank Gothic Medium' The only thing is, if oyu look carefully at the navbar i uploaded, theeres a very slight pattern in the background, doesnt look like much as the navbar on its own, but does make a difference to the layout, but then i suppose, where you have put background:#color, i could just put background:(url)link repeat-x; couldnt i? This is the bg file... Edited March 17, 201214 yr by Kirk Freeman
March 17, 201214 yr Thats excellent, its what im trying to create, but with the font 'Bank Gothic Medium' The only thing is, if oyu look carefully at the navbar i uploaded, theeres a very slight pattern in the background, doesnt look like much as the navbar on its own, but does make a difference to the layout, but then i suppose, where you have put background:#color, i could just put background:(url)link repeat-x; couldnt i? This is the bg file... That is correct.
March 17, 201214 yr Author That is correct. Nice, i just tried it out on Dreamweaver, and it does precisely what i want it to do, saweeeeet! One of my first topics on these forums n i learned something already! I could get used to this haha Hi five!
March 18, 201214 yr Thank you, so how come when you right 15px it gives you thirty? I don't know if you are using Firebug or Chrome Developer Tools, but if you are not, start doing it! You will get the answer to such questions much more easily and quickly. Not that I want to discourage you to seek help on the forums. Just a suggestion that might improve your workflow
March 18, 201214 yr I don't know if you are using Firebug or Chrome Developer Tools, but if you are not, start doing it! You will get the answer to such questions much more easily and quickly. Not that I want to discourage you to seek help on the forums. Just a suggestion that might improve your workflow IE developer tools will do it just as well.
March 18, 201214 yr Whichever he prefers. I'm definitely not gonna preach the use of anything specific.
March 19, 201214 yr Author To be honest, and i dont know whether its just me, but i dislike IE with a passion! Am i own my own there?
March 19, 201214 yr To be honest, and i dont know whether its just me, but i dislike IE with a passion! Am i own my own there? I second that, a browser that doesn't comply with web standards is something to really hate! Fortunately there's plenty of workarounds to follow. Edited March 19, 201214 yr by Dissident
March 19, 201214 yr IE9 is not too bad. I've never had a problem with it. I meant earlier versions, such as IE 7-8, but it's improving drastically now with IE 9 and 10. Edited March 19, 201214 yr by Dissident
March 19, 201214 yr Author I meant earlier versions, such as IE 7-8, but it's improving drastically now with IE 9 and 10. I haven't given IE9 a fair trial yet to be honest, so i shan't slag it off yet! But i think my favourite has to be safari!
Create an account or sign in to comment