- This topic is empty.
-
AuthorPosts
-
February 24, 2012 at 5:27 pm #36832
happybuddha
MemberHello,
Am fairly new to CSS and am trying to implement a tabbed navigation on a JSF based application.
I am able to hover around the little tabs and have mouseover and mouseout affects in place. However, what I am not able to do is, to make the commandLink styleClass to current (commandLink is translated to a tag at render time). Whenever I click on tab 1 I would want it to change its color and stay that way till another tab is clicked and when tab 3 or 4 are clicked, tab 1 goes back to its original state and the clicked tab becomes current. Below is my code. I would be grateful if someone can please tell me how to do this.
I have googled for this and the solutions are more or less in javascript and jquery. I cant do that since 1) there is no scope for jquery in this site 2) I can not get the id of the tag rendered, as it is randomly made.This is my relevant css file :
ul#ulS {
list-style: none;
margin: 0;
padding: 10;
}
ul#ulS a {
background-color: #848176;
color: #333333;
display: block;
height: 3em;
width: 11em;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
font: Arial;
font-weight: bold;
padding : 10px;
}
ul#ulS a:hover {
background-color: #D1CFCA;
background-position: 0 -120px;
}
ul#ulS a:hover span {
background-position: 100% -120px;
}
ul#ulS li {
float: left;
margin: 0 1px 0 0;
}
ul#ulS li.current {
background-color: Black;
}
ul#ulS li.current a {
background-position: 100% -60px;
color: #fff;
font-weight: bold;
}
ul#ulS li.current span {
background-position: 100% 160px;
border: 2px solid red;
}
and this is the relevant JSF part :
style="width: 1000px; position: absolute; margin-left: 5%; margin-top: -610px; border: 0px solid green;">
February 24, 2012 at 6:40 pm #97408happybuddha
MemberAlso if I change one of the menus to
i>
(yeah its styleClass instead of just style.
This should have atleast highlighted this menu, but it didnt. So there is something wrong am doing. What ? I dont know, -
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.