8 replies [Last post]
secaro
Offline
newbie
Last seen: 7 years 10 weeks ago
Joined: 2007-06-07
Posts: 8
Points: 0

Hey.

Im trying to add a active state on a link. My problem is that it seems like the active state only works on link that is like this <a href="#">link</a> and not on links like <a href="index.php?site1">link</a>

Can anyone confirm or disconfirm this ?

Angle brackets escaped in code example, please check your posts before submitting.

thepineapplehead
thepineapplehead's picture
Offline
Guru
Milton Keynes
Last seen: 2 weeks 19 hours ago
Milton Keynes
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9668
Points: 801

Could you perhaps post all

Could you perhaps post all your code, you know, like the forum guidelines ask?

Verschwindende wrote:
  • CSS doesn't make pies

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 32 weeks 3 days ago
London
Joined: 2004-06-06
Posts: 15650
Points: 2788

You must provide far more

You must provide far more detail than this if you require help, it's insufficient to be able to diagnose a problem by.

What do you mean by 'active' state? a true pseudo :active state? that is triggered by a click/key press and which lasts as long as the action takes to complete; or do you mean a styled link that represents the page one is viewing?

Regardless we will need to see how your coding things CSS and HTML. (as per the sticky posting guidelines ask!)

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

secaro
Offline
newbie
Last seen: 7 years 10 weeks ago
Joined: 2007-06-07
Posts: 8
Points: 0

give me 5 minutes. i need to

give me 5 minutes. i need to rewrite the code. Its not written by the rules.

secaro
Offline
newbie
Last seen: 7 years 10 weeks ago
Joined: 2007-06-07
Posts: 8
Points: 0

HTML & CSS

here comes the html

Untitled Document

index
sitemap
print

and here is the CSS

.head_hjem a {
text-indent:-666em;
height: 26px;
background:url(menu/hjem.png) no-repeat;
width: 102px;
float: left;
}
.head_hjem a:link {
width: 102px;
display:block;
text-indent:-666em;
background:url(menu/hjem.png);
}
.head_hjem a:active {
display:block;
text-indent:-666em;
background-position: 0 -26px;
}
.head_hjem a:hover {
display:block;
text-indent:-666em;
background-position: 0 -26px;
}
.head_salg a{
text-indent:-666em;
float: left;
width: 102px;
height: 26px;
background:url(menu/salg.png) no-repeat;
}
.head_salg a:link {
width: 102px;
display:block;
text-indent:-666em;
background:url(menu/salg.png);
}
.head_salg a:active {
display:block;
text-indent:-666em;
background-position: 0 -26px;
}
.head_salg a:hover {
display:block;
text-indent:-666em;
background-position: 0 -26px;
}
.head_utleie a{
text-indent:-666em;
float: left;
width: 102px;
height: 26px;
background:url(menu/utleie.png);
}
.head_utleie a:link {
width: 102px;
height:26px;
float:left;
text-indent:-666em;
background:url(menu/utleie.png);
}
.head_utleie a:active {
display:block;
text-indent:-666em;
background-position: 0 -26px;
}
.head_utleie a:hover {
display:block;
text-indent:-666em;
background-position: 0 -26px;
}

.head_menu {
width: 630px;
height: 26px;
float: left;
background-color:#FFFFFF;
position:relative;
top: 2em;
}

use <code> tags rather than BB code tags

secaro
Offline
newbie
Last seen: 7 years 10 weeks ago
Joined: 2007-06-07
Posts: 8
Points: 0

how do i make the whole html

how do i make the whole html as a comment ?

secaro
Offline
newbie
Last seen: 7 years 10 weeks ago
Joined: 2007-06-07
Posts: 8
Points: 0

i use a background picture

i use a background picture that is 52 pixels high.

normal state, the first 26 px

hoover state, the last 26 px

active state, the last 26 px

But when i hit the link/button the active state seems not to work because its using the first 26 px like normal state does. This happen if i use a link like <a href="link.php?site" rel="nofollow">link</a>

If i use this link <a href="#" rel="nofollow">link</a> the active state works. But i dont want to use # as link

secaro
Offline
newbie
Last seen: 7 years 10 weeks ago
Joined: 2007-06-07
Posts: 8
Points: 0

nevermind

Nevermind.. I figured out that its not possible to do what i want in css. i need to use javascript or php

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 32 weeks 3 days ago
London
Joined: 2004-06-06
Posts: 15650
Points: 2788

Oh ok was just going to

Oh ok Smile was just going to mention that you should just place the image on the 'a' rather than 'a:link' and that ':active' must follow after ':hover' i.e it's the last pseudo state to be declared.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me