![]() |
What is the best practice for this?
Hiya
This is only my second post and I am still learning the best practices of code. Basically I found a solution to my problem but I want to know if I should usually do it this way? It has taken me a LONG time to get this to work but I couldn't find any other way to do it online/in my books (not sure what to google!) I wanted to make a header/navigation bar that overlapped so i had one header image and then 6 navigation buttons. I couldn't get the navigation buttons to lie flush with each other so I put them in a table and then creaded a new empty table row to bring it down so it would align in the right place with the header. I had an issue that I needed the alignment on the left to work correctly so that it fitted in the right space and this would only work when the window was on max but not when minimized. This worked when I used a cell space and I bet there's a much easier way to do this! So any info would be very appreciated thank you :) Here is the website: www.kieronhuntdesign.com/contact Code:
<div class="header">Code:
#top { |
Best practices:
Don't use tables for layout. If you search CSS navigation bar there are many tutorials to study. Code:
<td width="100"> <font color="white">                        </font></td>The font tag is obsolete. Don't use nbsp's repeatedly, this is a poor practice; use margins to separate elements (or float elements, etc.). Code:
#top { |
Thank you!
I knew what I was doing wasn't correct but had no idea how to go about it. I only started using CSS about a month ago |
Quote:
Eventually.. floatutorial is very good, but there are other things you might study before this. There are many resources in the Sticky. |
Quote:
|
Quote:
And html and css by Jon Duckett I'm just trying to get the practice and used to it by doing my own and my fiance's websites.. Thank you for the resource suggestions |
Some of the things I wanted to do were not covered in the book so I just tried to google them. It's hard to know what are good/bad suggestions though. The table idea was recommended to someone else on a forum so that's why I used that. I had made a navigation bar before (www.midlandspolechampionships.co.uk) but I didn't have to use hovers and align the buttons in the same way which made it seem more complicated
|
Quote:
The HTML secion isn't too bad but the programming languages are significantly out of date - particularly JavaScript where most of the commands they use in the introductory tutorials are either obsolete or have been re-purposed. The site is a good history of how things used to be done at the end of the 20th Century but far less useful for how things should be done now. |
That book by Jon Duckett is very good. Going a little further/deeper, CSS The Missing Manual is very good as well. (It's from 2009 but still very relevant.)
|
Thank you for the info AndrewGSW and felgall. I am very interested in learning the up to date info and doing things correctly rather than just getting by with things that work. Will get hold of a copy of CSS The Missing Manual!
|
| All times are GMT +1. The time now is 05:31 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.