In My code I have
<div class="row-fluid"><div class="span12" style="color:red">${fn:length(alertStatusForm.totalNotSentRecipient)}</div></div>
Still Its not working
Please suggest
You must apply the CSS directly to the <a>. <a> elements will not inherit the font color by default.
CSS:
.span12 a{
color: red
}
a:visited{
color: red
}
Use this
.span12 a{
color:#000;
}
.span12 a
{
color : #FF0000;
}
.span12 a:visited
{
color: #FF0000;
}
Related
I have a base CSS that defines this:
a:hover, a:focus {
color: black;
}
I want to have a specific link that overrides and does not trigger focus, but still triggers hover.
How can i do something like this to override the color setting?
a:focus{
color: none;
}
I've tried color:transparent to no avail, focus still triggers.
Try This
a:hover{
color:green;
}
.class:hover, .class:focus {
color: red;
}
dsadsfdsfsd
dsadsfdsfsd
I think you might need like this. This will inherit the color from parent.
a:focus {
color: inherit !important;
}
Please apply this css.
a:hover { text-decoration: none !important; color :none; border: 0px; -moz-outline-style: none;}
a:focus { text-decoration: none !impoartant; outline: none;-moz-outline-style: none;}
You should use initial to set element style to default.
a:focus {
color: initial !important;
}
Is there a :hover selector that can be used when an 'a' tag is clicked it causes it to change color and then turns back when the click is released?
Any help is much appreciated. :D
Use :active selector, this is used to select the active element, in this case the a element.
a:active{
color:purple;
}
<a>Click Me</a>
try this one too
https://jsfiddle.net/kLju23fx/2/
<code>
a:hover {
color: hotpink;
}
a:active {
color: blue;
}
a:link {
color: red;
}
a:visited {
color: green;
}
</code>
Why does the text not remain white once hover is engaged? Should the active state keep this white?
a:hover {
color: green;
}
nav ul {
background-color: #444;
text-align: center;
}
nav a {
color: #fff;
}
nav a.active {
color: #fff;
}
nav a:hover {
background-color: #005f5f;
}
<nav>
<ul>
<li>Home</li>
</ul>
</nav>
Well, you did set the color to green on hover. Remove that declaration and you should be good to go:
/*a:hover {
color:green;
}*/
Edit:
To answer your second question, the active "state" (in your CSS it is a class) keeps it white because the selector nav a.active has a higher specificity than a:hover.
Remove the following.
a:hover {
color:green;
}
Or if you wish to understand what's happening, change it to:
a:hover {
color:red;
}
Use CSS for the required text
a:hover {
color:#000000;
}
Is it possible like lets say the text in the div header has a red hover, and the text in the div in the footer a white hover?
Or is this just not possible and can you only set 1 style for the whole document?
This is very much possible, just like any other element you can style them separately by being more specific.
If you have this HTML:
<div id="top">
First link
</div>
<div id="bot">
Second link
</div>
With this CSS you would style both links:
a:hover {
color: #000;
}
With this CSS you can style them separately:
#top a:hover {
color: #f00;
}
#bot a:hover {
color: #fff;
}
You can set as pretty much as many as you want to if you just hook it right:
/* every a:hover has color red */
a:hover { color: red; }
/* #footer a:hover has color green. */
#footer a:hover { color: green; }
/* Every link that has class ".ThisClass" will have yellow color */
a.ThisClass:hover { color: yellow; }
Yes this is possible.
#header a:hover {
color: #f00;
}
#footer a:hover {
color: #0f0;
}
http://jsfiddle.net/wrygB/2/
You may want to split this though so you can use the same hovers elsewhere. In which case you would do:
.main:hover {
color: #f00;
}
.sub:hover {
color: #0f0;
}
And then you can apply a class of main or sub to any element to get the hover effect.
Well you'd just select the element the a:link is within, and apply styles like that.
i.e
#header a:hover { color: red; }
#footer a:hover { color: white; }
The CSS active link style is being correctly applied in IE7, FF, and Safari but is not applied IE6.
.side_nav a.active
{
color:#FFFFFF;
background-color:#9F1F63;
}
Interestingly the background color (background-color:#9F1F63;) is being applied in IE6 but not the font color (color:#FFFFFF;)
Any ideas on why this is happening and how I can fix it appreciated.
The complete styling for the nav below:
.side_nav
{
text-align : left;
margin-left: -10px;
}
.side_nav ul
{
list-style-type: none;
list-style-position:inside;
margin-left:0px;
}
.side_nav li
{
margin-top: 10px;
display: list-item;
list-style-type:none;
}
.side_nav a, .side_nav a:visited
{
text-decoration: none;
color : #9F1F63;
font-weight : bold;
padding: 5px 10px 5px 10px;
}
.side_nav a:hover
{
color:#B26D7F;
}
.side_nav a.active
{
color:#FFFFFF;
background-color:#9F1F63;
}
EDIT: Thanks but the suggestions haven't helped. When I change to a:active the active effect does not work in any browser. I think this might be due to how I have applied the style in the HTML.
<div class="side_nav">
<a class="active" href="Page1.aspx">Page1</a><br />
Page2<br />
Page3<br />
</div>
In IE6, it matters which order you specify the anchor links. You should specify them in this order to achieve the intended result: first a:link, then a:visited, a:hover and a:active.
Your CSS has a period where there should be a colon, in .side_nav a.active (should be .side_nav a:active
With this fixed, it works for me in IE6.
I tried copying your code, and the format did work.
Your problem is you see the link as visited - you have both formatting of the visited and active (so you have the purple background and the purple text).
You should override the color for visited links with the active class:
.side_nav a.active, .side_nav a.active:visited
{
color: #FFFFFF;
background-color: #9F1F63;
}
Try adding a more specific selector to .side_nav a.active such as div .side_nav a.active where div is the parent element.
The color is probably being overwritten from the .side_nav a rule.
Also, you may have a typo - are trying to use the :active selector?
Try to use !important. Like this:
.side_nav a.active
{
color: #FFFFFF !important;
background-color: #9F1F63;
}