Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-23-2008, 11:41 AM   PM User | #1
runnerjp
Regular Coder

 
Join Date: Nov 2006
Posts: 601
Thanks: 1
Thanked 2 Times in 2 Posts
runnerjp can only hope to improve
styling menu

hey guys i have this so far
Code:
div#navbar2 {
	height: 30px;
	width: 100%;
	border-top: solid #000 1px;
	border-bottom: solid #000 1px;
	background-color: #99b3b4;
text-align:center;
}
div#navbar2 ul {
	margin: 0px;
	padding: 0px;
	font-family: Arial, Helvetica, sans-serif;
	font-size: small;
	color: #FFF;
	line-height: 30px;
	white-space: nowrap;
}
div#navbar2 li {
	list-style-type: none;
	display: inline;

}
div#navbar2 li a {
	text-decoration: none;
	padding: 7px 10px;
	color: #FFF;
}
div#navbar2 li a:link {
    color: #FFF:
}
div#navbar2 li a:hover {
    font-weight: bold;
    color: #000000;
    background-color: #e4ebeb;
}
but what i can figure out is how to show the link they are on as a selected button so having the button be red if they are on that link...

Code:
<div id="navbar2">
<ul>
<li><a href="index.php?page=update">Basic</a></li>
<li><a href="link2.html%20">Button 2</a></li>
<li><a href="link3.html%20">Button 3</a></li>
</ul>
</div>
runnerjp is offline   Reply With Quote
Old 05-23-2008, 12:09 PM   PM User | #2
jhaycutexp
Regular Coder

 
Join Date: Apr 2008
Location: Manila, Philippines
Posts: 249
Thanks: 2
Thanked 12 Times in 12 Posts
jhaycutexp is an unknown quantity at this point
create a style that would identify it as an active...

i usually use a class like so
Code:
a .active{style...}
jhaycutexp is offline   Reply With Quote
Old 05-23-2008, 12:37 PM   PM User | #3
runnerjp
Regular Coder

 
Join Date: Nov 2006
Posts: 601
Thanks: 1
Thanked 2 Times in 2 Posts
runnerjp can only hope to improve
div#navbar2 li a:active {font-weight: bold;
color: #000000;
background-color: #e4ebeb;}

like this?
runnerjp is offline   Reply With Quote
Old 05-23-2008, 03:19 PM   PM User | #4
jcdevelopment
Senior Coder

 
jcdevelopment's Avatar
 
Join Date: Oct 2007
Location: Cowboy Nation
Posts: 2,171
Thanks: 173
Thanked 257 Times in 257 Posts
jcdevelopment will become famous soon enoughjcdevelopment will become famous soon enough
Quote:
Originally Posted by runnerjp View Post
div#navbar2 li a:active {font-weight: bold;
color: #000000;
background-color: #e4ebeb;}

like this?

I believe thats how he meant it, unless you create a class called

Code:
.active
jcdevelopment is offline   Reply With Quote
Old 05-23-2008, 03:37 PM   PM User | #5
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
We had a good thread on this , see Change link text style for current page.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 05-23-2008, 06:30 PM   PM User | #6
runnerjp
Regular Coder

 
Join Date: Nov 2006
Posts: 601
Thanks: 1
Thanked 2 Times in 2 Posts
runnerjp can only hope to improve
hey thanks i took the website and got it to work... but
#basic a,
#test a
{
font-weight: bold;
color: black;
background-color: #e4ebeb;

does not make the writing black for some reason its white :S
Code:
div#navbar2 {
	height: 30px;
	width: 100%;
	border-top: solid #000 1px;
	
	background-color: #99b3b4;
text-align:center;
}
div#navbar2 ul {
	margin: 0px;
	padding: 0px;
	font-family: Arial, Helvetica, sans-serif;
	font-size: small;
	color: #FFF;
	line-height: 30px;
	white-space: nowrap;
}
div#navbar2 li {
	list-style-type: none;
	display: inline;

}
div#navbar2 li a {
	text-decoration: none;
	padding: 7px 10px;
	color: #FFF;
}
div#navbar2 li a:link {
    color: #FFF:
}
div#navbar2 li a:hover {
    font-weight: bold;
   
}
#basic a,
#test a
{
  font-weight: bold;
   color: black;
    background-color: #e4ebeb;
}
runnerjp is offline   Reply With Quote
Old 05-23-2008, 07:22 PM   PM User | #7
jcdevelopment
Senior Coder

 
jcdevelopment's Avatar
 
Join Date: Oct 2007
Location: Cowboy Nation
Posts: 2,171
Thanks: 173
Thanked 257 Times in 257 Posts
jcdevelopment will become famous soon enoughjcdevelopment will become famous soon enough
is that all of your CSS? Can you post the html also or maybe a link? It may be that something is overwriting it.
jcdevelopment is offline   Reply With Quote
Old 05-23-2008, 09:47 PM   PM User | #8
runnerjp
Regular Coder

 
Join Date: Nov 2006
Posts: 601
Thanks: 1
Thanked 2 Times in 2 Posts
runnerjp can only hope to improve
<div id="navbar2">
<ul>
<li id="basic"> <a href="index.php?page=update">Basic</a></li>
<li id="ill"><a href="link2.html%20">Button 2</a></li>
<li id="i1"><a href="link3.html%20">Button 3</a></li>
</ul>
</div>


thats everything
runnerjp is offline   Reply With Quote
Old 05-23-2008, 09:51 PM   PM User | #9
jcdevelopment
Senior Coder

 
jcdevelopment's Avatar
 
Join Date: Oct 2007
Location: Cowboy Nation
Posts: 2,171
Thanks: 173
Thanked 257 Times in 257 Posts
jcdevelopment will become famous soon enoughjcdevelopment will become famous soon enough
why do you need to set the nav bar <a>

Code:
div#navbar2 li a:link {
    color: #FFF:
}
When you define the same link with this

Code:
#basic a,
#test a
{
  font-weight: bold;
   color: black;
    background-color: #e4ebeb;
}
Just get rid of the nav2 a:active color. Thats what makes it white.
jcdevelopment is offline   Reply With Quote
Old 05-24-2008, 03:12 PM   PM User | #10
runnerjp
Regular Coder

 
Join Date: Nov 2006
Posts: 601
Thanks: 1
Thanked 2 Times in 2 Posts
runnerjp can only hope to improve
ok but i have now done it like this
Code:
div#navbar2 {
	height: 30px;
	width: 100%;
	border-top: solid #000 1px;
	
	background-color: #99b3b4;
text-align:center;
}
div#navbar2 ul {
	margin: 0px;
	padding: 0px;
	font-family: Arial, Helvetica, sans-serif;
	font-size: small;

	line-height: 30px;
	white-space: nowrap;
}
div#navbar2 li {
	list-style-type: none;
	display: inline;

}
div#navbar2 li a {
	text-decoration: none;
	padding: 7px 10px;
	color: #FFF;
}

div#navbar2 li a:hover {
    font-weight: bold;
   
}
#basic a,
#test a
{
  font-weight: bold;
   color: black;
    background-color: #e4ebeb;
}
but the text is still white
runnerjp is offline   Reply With Quote
Old 05-24-2008, 03:22 PM   PM User | #11
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
That's what you've applied in
Quote:
div#navbar2 li a {
text-decoration: none;
padding: 7px 10px;
color: #FFF;
}
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 05-24-2008, 04:53 PM   PM User | #12
runnerjp
Regular Coder

 
Join Date: Nov 2006
Posts: 601
Thanks: 1
Thanked 2 Times in 2 Posts
runnerjp can only hope to improve
ok but what about the other boxes that are not selected... how can i make there text white then ~:S
runnerjp is offline   Reply With Quote
Old 05-24-2008, 05:18 PM   PM User | #13
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Have you followed the link that I've posted in my previous post?
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 05-24-2008, 07:53 PM   PM User | #14
runnerjp
Regular Coder

 
Join Date: Nov 2006
Posts: 601
Thanks: 1
Thanked 2 Times in 2 Posts
runnerjp can only hope to improve
i did indeed thats how i got the selected llink working...but the problem is making the NON selected links white text to match there background

like so

div#navbar2 {
height: 30px;
width: 100%;
border-top: solid #000 1px;
color: #FFF;
background-color: #99b3b4;
text-align:center;
}

but it does not work
runnerjp is offline   Reply With Quote
Old 05-24-2008, 10:44 PM   PM User | #15
bazz
Master Coder

 
Join Date: Apr 2003
Location: in my house
Posts: 5,211
Thanks: 39
Thanked 201 Times in 197 Posts
bazz will become famous soon enoughbazz will become famous soon enough
Have you set any default attributes like this


Code:
body {
color : #fff;
}
bazz
bazz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:33 AM.


Advertisement
Log in to turn off these ads.