What would be the best way to creat my navigation?

  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Joined: Apr 24, 2004
  • Posts: 1013
  • Loc: Living In Today
  • Status: Offline

Post May 27th, 2004, 2:15 pm

LOL rtm, you really screwed me up now. I got firefox, and saw the difference in the way it showed the page. So what do i do?? I go and edit the page so it looks good in firefox, but now it look like crap in IE. LOL im so screwed. Is the best thing to do now is redo the site using divs in place of tables? would that clear up the majority of the problems? appreciate the help.
Yesterday is history.Tomorrow is mystery.Today is a gift.
Car Audio Sytems
LED Emergency Lights
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post May 27th, 2004, 2:15 pm

  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Mar 24, 2004
  • Posts: 1855
  • Loc: Uk
  • Status: Offline

Post May 27th, 2004, 2:37 pm

Step One is still valid code. Especially the doctype. Use HTML 4.01:

Code: [ Select ]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2.   "http://www.w3.org/TR/html4/loose.dtd">


The reason I say this is that IE6 has a "quirks mode". If you don't put in a doctype it goes into quirks mode and starts playing up. If you put in a valid doctype then it starts behaving more like mozilla.

If you are lucky this could fix the problem.


Quote:
Is the best thing to do now is redo the site using divs in place of tables

If you are just starting to learn CSS then you will need a week or two to learn how. I'm guessing that isn't an option with this project??
CSS website design tutorials
  • gsv2com
  • Professor
  • Professor
  • User avatar
  • Joined: Jan 25, 2004
  • Posts: 776
  • Loc: Nippon
  • Status: Offline

Post May 28th, 2004, 12:59 am

Your best bet would be to use ul's and li's for your links since a navigation bar is nothing but a list of pages.

Doing your links as

Code: [ Select ]
<a>link</a> <a>link</a>


would work, but it'd fall apart ungracefully on browsers with little or no css support. The best way to do it would be:

Code: [ Select ]
<ul id="nav">
   <li><a href="page.htm">1</a></li>
   <li><a href="page2.htm">2</a></li>
   <li><a href="page3.htm">3</a></li>
   <li><a href="page4.htm">4</a></li>
   <li><a href="page5.htm">5</a></li>
</ul>
  1. <ul id="nav">
  2.    <li><a href="page.htm">1</a></li>
  3.    <li><a href="page2.htm">2</a></li>
  4.    <li><a href="page3.htm">3</a></li>
  5.    <li><a href="page4.htm">4</a></li>
  6.    <li><a href="page5.htm">5</a></li>
  7. </ul>

In your css, you only need a little bit of code to get started. Feel free to experiment the heck out of this.
Code: [ Select ]
<style type="text/css">
ul#nav{margin:0; list-style-type:none;}
ul#nav li{display:inline;} // don't do that if you want links to be vertical.
</style>
  1. <style type="text/css">
  2. ul#nav{margin:0; list-style-type:none;}
  3. ul#nav li{display:inline;} // don't do that if you want links to be vertical.
  4. </style>

This should work for you. Mess with your margins, padding, colors, and backgrounds to get this to look exactly the way you want. No need for tables or div's what-so-ever. Just lean, mean straight html with a dab of css on the side.

A good website to learn more about list-style navigation: http://css.maxdesign.com.au/

Check out the listamatics.
  • gsv2com
  • Professor
  • Professor
  • User avatar
  • Joined: Jan 25, 2004
  • Posts: 776
  • Loc: Nippon
  • Status: Offline

Post May 28th, 2004, 1:04 am

You could actually do your whole design without the use of a single table. This would be a fun team project. All you need is a few "float:right"s thrown in there and you're good to go.
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Mar 24, 2004
  • Posts: 1855
  • Loc: Uk
  • Status: Offline

Post May 28th, 2004, 1:14 am

A list of links is <i>always</i> the best way but I was trying to avoid saying this. For someone who has only a small knowledge of CSS, taming lists is a pain in the ass lol

Quote:
You could actually do your whole design without the use of a single table

Unless you have a grid, you <i>never</i> need to use a table.I'm still not an expert, but I challenge anyone to show me a non-tabular table layout that I cannot reproduce with CSS.
CSS website design tutorials
  • gsv2com
  • Professor
  • Professor
  • User avatar
  • Joined: Jan 25, 2004
  • Posts: 776
  • Loc: Nippon
  • Status: Offline

Post May 28th, 2004, 1:23 am

I'm going to spend the next couple of weeks on that. :) You ready for a challenge rtm? I'm going to produce the ugliest freakin table layout you've ever seen just so I can give you the challenge of your dreams!

LOL.

Just kidding. I don't have the time. You're absolutely right, and I already know it. :)
  • gsv2com
  • Professor
  • Professor
  • User avatar
  • Joined: Jan 25, 2004
  • Posts: 776
  • Loc: Nippon
  • Status: Offline

Post May 28th, 2004, 1:25 am

rtm223 wrote:
A list of links is <i>always</i> the best way but I was trying to avoid saying this. For someone who has only a small knowledge of CSS, taming lists is a pain in the ass lol

Well, the first time, at least. After you do it a few times and get to know the css, it becomes less painful than doing it with tables IMHO. Plus, no better feeling than after creating sleek code.

Note: I feel like such a hypocrite since the navbar on GrooveSeeker (http://www.gsv2.com) is still table based. :oops: I'll get to that soon. I figured out a way to completely eliminate all tables from that site. Well, maybe...
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Mar 24, 2004
  • Posts: 1855
  • Loc: Uk
  • Status: Offline

Post May 28th, 2004, 1:36 am

on groveseeker: Well, float them left and remove the text zoom disabler. if you make the UL fixed width, use padding to set the widths and heights of the li's and float, they will go onto two lines if someone uses text zoom. Which is about as elegant accessibility as you could possibley hope for :)

On Sharks page, you wouldn't want to float:right as that would place the links "above" the content (in html terms), so float the content left instead

Even better, use absolute positioning, as there is no footer and you then eliminate the possibility of encountering either of the IE Float Bugs
CSS website design tutorials
  • gsv2com
  • Professor
  • Professor
  • User avatar
  • Joined: Jan 25, 2004
  • Posts: 776
  • Loc: Nippon
  • Status: Offline

Post May 28th, 2004, 1:41 am

Believe me, I'm pretty aware of what needs to be done on gsv2, I just need to DO IT. :) I just moved into a new apartment yesterday and got a new job two months ago, so things have been a bit too hectic to work on my own crap.........

... one of these days ... :) Thanks though.
  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Joined: Apr 24, 2004
  • Posts: 1013
  • Loc: Living In Today
  • Status: Offline

Post May 28th, 2004, 5:31 am

LOL wow guys thanks for the input! in response to your first question rtm, I actually have 4 months to complete this project. Its basically an online datacenter, the company currently has a website, but they are looking for an upgrade to introduce in the fall.

So please give me all the advice you got man! My intention is to have most of the site in CSS and use PHP quite a bit. PHP i can handle, more or less, its the CSS im having trouble with.

So Im going to try the codes you and gsv2 suggested, adn Ill be back when I need more help :D
Yesterday is history.Tomorrow is mystery.Today is a gift.
Car Audio Sytems
LED Emergency Lights
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Mar 24, 2004
  • Posts: 1855
  • Loc: Uk
  • Status: Offline

Post May 28th, 2004, 6:56 am

Four months you say? Well, first step is to get used to CSS syntax, you will need to know:

basic tag selection

selecting specific tags by class and id:
Code: [ Select ]
.classname{
  /*styles for this class here*/
}
#id{
  /*styles for this id here*/
}
  1. .classname{
  2.   /*styles for this class here*/
  3. }
  4. #id{
  5.   /*styles for this id here*/
  6. }


selecting nested elements:
Code: [ Select ]
div a{
  /*these styles will apply to the and &lt;a> tags that
  are INSIDE a div. a's not inside a div will not be affected*/
}
  1. div a{
  2.   /*these styles will apply to the and &lt;a> tags that
  3.   are INSIDE a div. a's not inside a div will not be affected*/
  4. }


pseudo classes for links:
Code: [ Select ]
a{
  /*these are the styles for a link*/
}
a:hover{
  /*these are the styles for link when you hover
  the mouse over it*/
}
a:visited{
  /*these are the styles for links that have already
  been visited*/
}
  1. a{
  2.   /*these are the styles for a link*/
  3. }
  4. a:hover{
  5.   /*these are the styles for link when you hover
  6.   the mouse over it*/
  7. }
  8. a:visited{
  9.   /*these are the styles for links that have already
  10.   been visited*/
  11. }


Thats it really for syntax, then just start learning properties - play about with position:absolute; on some divs, using the left, right, top, bottom, width and height properties with it.

Hopefully by this point <a href="http://www.caffeinefuelled.net">caffiene fuelled</a> will be up and running, otherwise start googling CSS layouts.

Also try googling taming lists or styling lists
CSS website design tutorials
  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Joined: Apr 24, 2004
  • Posts: 1013
  • Loc: Living In Today
  • Status: Offline

Post May 28th, 2004, 7:10 am

:D u da man rtm! LOL. here is the thing though, no matter what i do, firefox and IE simply do not display the page the same. Look @ this page:

http://ww.playersnmotion.com/main_site/index2.html

if you view it in both browsers you can see a huge difference. for instance look at Subnav one, in firefox, the links are all lined up neatly, in IE its like they are centered, the are not even on the left side. What would be causing this? I made that page so basically im going to rip apart the code and rewrite it. So im thinking this thread ma get rather long :D
Yesterday is history.Tomorrow is mystery.Today is a gift.
Car Audio Sytems
LED Emergency Lights
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Mar 24, 2004
  • Posts: 1855
  • Loc: Uk
  • Status: Offline

Post May 28th, 2004, 7:29 am

SharkShark wrote:
What would be causing this?


Internet explorer being rather inferior....

I saw a site once that lists all the known css bugs for browsers. The gecko browsers had 3 (although I found a new one last week, so four) Internet Explorer 6 has loads, there could be any number of things causing the problem. When you add onto it that you are using html attributes as well, it could be any of a thousand things.

Whilst you are learning CSS, you might as well start using xhtml at the same time - that wil take all of 20 minutes to learn lol.


The only other thing I can say is to bear in mind the box model. At some point you will need to learn the tantek celic box model hack, which is a pain but infinately useful. Basically when you specify the width of an element, this is the content width, padding and borders are extra.
Code: [ Select ]
div{
  width:200px;
  padding:40px;
  border:10px;
}
  1. div{
  2.   width:200px;
  3.   padding:40px;
  4.   border:10px;
  5. }


gives 200px content + (40px+10px)*2
total 300px border to border.

THIS IS IMPORTANT
CSS website design tutorials
  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Joined: Apr 24, 2004
  • Posts: 1013
  • Loc: Living In Today
  • Status: Offline

Post May 28th, 2004, 8:25 am

LOL i may have to pay you part of my commision at this rate rtm. :D I appreciate the help. OK, i think i got XTHML down. I just removed all tables from the webpage and am proceding to start working with div. *sigh* I never had any problems until i started trying to get proffesional. :P Just keep an eye on this thread cause Im gonna have a million question as we go along. :)
Yesterday is history.Tomorrow is mystery.Today is a gift.
Car Audio Sytems
LED Emergency Lights
  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Joined: Apr 24, 2004
  • Posts: 1013
  • Loc: Living In Today
  • Status: Offline

Post May 28th, 2004, 4:46 pm

OK next prob :P

I am trying to get the top bg image (the lines across the top) to stretch across the top. It will work in IE (go figure) but it wont in firefox (go figure again) here is the code on the page:

Code: [ Select ]
<img class="x" src="images/top_bg.jpg" width="100%" height="209">


And this is the code on the stylesheet.

Code: [ Select ]
img.x
{
position:absolute;
left:0px;
top:0px;
z-index:-1
}
  1. img.x
  2. {
  3. position:absolute;
  4. left:0px;
  5. top:0px;
  6. z-index:-1
  7. }


How should I change and or edit this? Thanks
Yesterday is history.Tomorrow is mystery.Today is a gift.
Car Audio Sytems
LED Emergency Lights
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post May 28th, 2004, 4:46 pm

Post Information

  • Total Posts in this topic: 32 posts
  • Users browsing this forum: No registered users and 125 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.