navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

CSS Roll Over Buttons

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> CSS Roll Over Buttons
Page: [1]
 
CelticDragon

 

Posts: 227
Joined: 11/14/2003
From: Dublin, Ireland
Status: offline

 
CSS Roll Over Buttons - 9/28/2004 4:18:05   
Hey guys, I'm getting to grips with CSS quite nicely now.... One or two questions though:

Is it possible to declare the height of a table cell/row in the td command?

I've tried with basic Height: 10px; but it didn't seem to work.....

Also, more importantly as I'm still using tables because I prefer them(!), I have some code that I have figured out for my navigation buttons but for some reason once the page has been visited, it only shows button 3, never button 2 (Button1: Light blue, Button2: Dark Blue, Button3: Purple).....

How do I get button 2 to show on a hover even when the page has been visited?

Thanking you!

STUPID EDIT: Would help if I showed my code, wouldn't it? :):)
a:link.button {
width: 118px;
height: 28px;
text-decoration: none;
background-image: url('images/button1.gif');
background-repeat: no-repeat;
color: #FFFFFF;
font-size:12px;
font-weight:bold;
font-family: Arial, Verdana, Helvetica, sans-serif;
text-align: left;
vertical-align:middle;
padding: 6px;
margin-left: 2px;
}

A:hover.button {
width: 118px;
height: 28px;
text-decoration: none;
background-image: url('images/button2.gif');
background-repeat: no-repeat;
color: #FFFFFF;
font-size:12px;
font-weight:bold;
font-family: Arial, Verdana, Helvetica, sans-serif;
text-align: left;
vertical-align:middle;
padding: 6px;
margin-left: 2px;
}

A:visited.button {
width: 118px;
height: 28px;
text-decoration: none;
background-image: url('images/button3.gif');
background-repeat: no-repeat;
color: #FFFFFF;
font-size:12px;
font-weight:bold;
font-family: Arial, Verdana, Helvetica, sans-serif;
text-align: left;
vertical-align:middle;
padding: 6px;
margin-left: 2px;
}

_____________________________

I Lost My Stuff - If you lost it, someone found it!
abbeyvet

 

Posts: 5095
From: Kilkenny Ireland
Status: offline

 
RE: CSS Roll Over Buttons - 9/28/2004 5:02:20   
There is a much easier way to make buttons than this, using simple lists.

Try it out - even if it seems a little confusing at first, it really does make it quick and easy once you get the hang of it:

http://css.maxdesign.com.au/listamatic/

_____________________________

Katherine

:: InKK Design :: InKK Domains

(in reply to CelticDragon)
Giomanach

 

Posts: 6090
Joined: 11/19/2003
From: England
Status: offline

 
RE: CSS Roll Over Buttons - 9/28/2004 5:47:43   
Try altering this, I used the following CSS here

.nav a.home{
	background-image: url(images/nav_home.gif);
	background-repeat: no-repeat;
	background-position: center center;
	padding-left: 83px;
	padding-right: 5px;
	padding-bottom: -10px;
}

.nav a:hover.home{
	background-image: url(images/nav_homeH.gif);
	background-position: center center;
}

.nav a.profile{
	background-image: url(images/nav_profile.gif);
	background-repeat: no-repeat;
	background-position: center center;
	padding-left: 83px;
	padding-right: 5px;
	padding-bottom: -10px;
}

.nav a:hover.profile{
	background-image: url(images/nav_profileH.gif);
	background-position: center center;
}

.nav a.services{
	background-image: url(images/nav_services.gif);
	background-repeat: no-repeat;
	background-position: center center;
	padding-left: 110px;
	padding-right: 5px;
	padding-bottom: -10px;
}

.nav a:hover.services{
	background-image: url(images/nav_servicesH.gif);
	background-position: center center;
}

.nav a.support{
	background-image: url(images/nav_support.gif);
	background-repeat: no-repeat;
	background-position: center center;
	padding-left: 95px;
	padding-right: 5px;
	padding-bottom: -10px;
}

.nav a:hover.support{
	background-image: url(images/nav_supportH.gif);
	background-position: center center;
}

.nav a.portfolio{
	background-image: url(images/nav_portfolio.gif);
	background-repeat: no-repeat;
	background-position: center center;
	padding-left: 115px;
	padding-right: 5px;
	padding-bottom: -10px;
}

.nav a:hover.portfolio{
	background-image: url(images/nav_portfolioH.gif);
	background-position: center center;
}

.nav a.contact{
	background-image: url(images/nav_contact.gif);
	background-repeat: no-repeat;
	background-position: center center;
	padding-left: 100px;
	padding-right: 20px;
	padding-bottom: -10px;
}

.nav a:hover.contact{
	background-image: url(images/nav_contactH.gif);
	background-position: center center;
}


But as Katherine says, their are easier ways

< Message edited by Giomanach -- 9/28/2004 6:35:25 >


_____________________________




(in reply to abbeyvet)
Donkey

 

Posts: 3869
Joined: 11/13/2001
From: Blackfield United Kingdom
Status: offline

 
RE: CSS Roll Over Buttons - 9/28/2004 6:13:25   
Dan

There is a repeated spelling error in your code "paading-right"

_____________________________

:)

I have a higher and grander standard of principle than George Washington. He could not lie; I can, but I won't.
Samuel Clemens

(in reply to Giomanach)
Giomanach

 

Posts: 6090
Joined: 11/19/2003
From: England
Status: offline

 
RE: CSS Roll Over Buttons - 9/28/2004 6:35:44   
Didn't notice, Thanks Peter

_____________________________




(in reply to Donkey)
CelticDragon

 

Posts: 227
Joined: 11/14/2003
From: Dublin, Ireland
Status: offline

 
RE: CSS Roll Over Buttons - 9/28/2004 7:31:55   
Hey Dan,

I think I have that figured, but I like the idea of people being able to see where they've been with the different color link, it's just that it gets boring then when they go to hover over it again....

Is there a line of code I'm missing to make it repeat the hover?

_____________________________

I Lost My Stuff - If you lost it, someone found it!

(in reply to Giomanach)
Giomanach

 

Posts: 6090
Joined: 11/19/2003
From: England
Status: offline

 
RE: CSS Roll Over Buttons - 9/28/2004 7:42:46   
YOur links should be in the following order:

a:link
a:visited
a:hover
a:active
a:focus

Just alter the order of them in your stylesheet and it should work fine

Dan

_____________________________




(in reply to CelticDragon)
CelticDragon

 

Posts: 227
Joined: 11/14/2003
From: Dublin, Ireland
Status: offline

 
RE: CSS Roll Over Buttons - 9/28/2004 7:48:16   
quote:

ORIGINAL: Giomanach

YOur links should be in the following order:

a:link I know this one
a:visited I know this one too
a:hover Have that one
a:active What does this one do? Which should it be the same as?
a:focus What does this one do? Which should it be the same as?

Just alter the order of them in your stylesheet and it should work fine

Dan


_____________________________

I Lost My Stuff - If you lost it, someone found it!

(in reply to Giomanach)
Giomanach

 

Posts: 6090
Joined: 11/19/2003
From: England
Status: offline

 
RE: CSS Roll Over Buttons - 9/28/2004 7:52:01   
Did you alter the order to what I gave?

active - if the link returns a page, it will be displayed as active. Using this is a simple, and easy visual way of finding dead links.

focus - What happens when you click on the link, sorta like the onFocus command in JS, but it only controls colors background etc, not browser behaviour

You need to have the heirarchy of CSS link formatting in the order given. The last two are not a requirement, just ensure that you have them in link, hover, visited order to ensure the hover always works.

I'm confusing you aren't I?

_____________________________




(in reply to CelticDragon)
CelticDragon

 

Posts: 227
Joined: 11/14/2003
From: Dublin, Ireland
Status: offline

 
RE: CSS Roll Over Buttons - 9/28/2004 8:05:46   
Woo hoo!!!

I get it, cheers Dan!

_____________________________

I Lost My Stuff - If you lost it, someone found it!

(in reply to Giomanach)
c1sissy

 

Posts: 5084
Joined: 7/20/2002
From: NJ
Status: offline

 
RE: CSS Roll Over Buttons - 9/28/2004 11:05:02   
Hi CD,
Here is a link for you that you should read that will help you out a bit understanding the links.
http://www.w3.org/TR/REC-CSS2/selector.html#pseudo-elements

I would suggest going through their whole site. The information in there is terrific.

And I believe that the focus part of the link elements is actually for forms. Its not specifically for linking pages.
There is an explaination here on this
http://www.frontpagewebmaster.com/fb.asp?m=221056

I hope this helps you out with this one CD.

have a great one!

_____________________________

Deb-aka-c4Ksissy
high panjandurum and alpha female of the silverback tribe
As decreed by Jesper 5-24-2003.
The only stupid question is... the one that is never asked!!
http://directory.css-styling.com
http://fmsforum.com
http://positioniseverything.net/
http://www.tanfa.co.uk/

(in reply to CelticDragon)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> CSS Roll Over Buttons
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts