Jump to content


Photo

CSS/PHP Tabs


  • Please log in to reply
2 replies to this topic

#1 Bavilo

Bavilo
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 26 April 2006 - 03:13 AM

Ok this one should be relativly easy for you hardcore coders out there...I was browsing on Wiki one day and decided that my page needs those slick Tabs at the top aswell... I looked at quiet a few tutorials examples you name it. I got the Tabs looking nice and everything but i till have a slight problem. The "active" tab, the tab that is standing out from the other when its clicked. Annoyed, confused, and devestated, i spent several hours looking at more examples and this is what i found out. When ever you click a link, MAGICALLY the tab has a ID tag in the hyperlink. So instead of a href="blah.html"> it now has a href="blah.html" id="selected"> or the similar. This would be pretty much common sense, the link now has the propertied given by the style sheet under #selected. Only problem is...how in the HELL do you get that ID tag there in the first place? i mean all these tutorials are great, but they dont show me how they get this Tag there. I've even thought about using PHP, such as this (im not a php coder, so this WILL be wrong) a href="blah.html" value="selected"> then when you click the link, it will submit the value, such as a POST field in php, out it into a string, and then in my body id="$string"> thus giving me the effect. Is this possible? if so, how? I would much rather go the css route though. I hope ANYBODY out there could help me :(

Thanks in advance
Mike

#2 Bavilo

Bavilo
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 26 April 2006 - 03:57 AM

Anyone? :(

#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 26 April 2006 - 10:14 AM

To the id bit is not a tag it is a HTML attribute. Attributes are the little commands inside a HTML tag ie, class, ie, href etc.

To get the id there you just simple type it in! Ie on blah.html you do this:
<a href="blah.html" value="selected">Blah page</a><a href="blah2.html">Blah2 page</a>
Then when you cliick on Blah 2 page it goes to blah2.html and in that file you just code id="selected" in the secound acnhor and remove the id from the first anchor tag.

This is how this effect is done.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users