Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove hover effect from CSS?

Tags:

html

css

class

I'm currently having a text as hyperlink and on this some CSS code is getting applied. Due to which on hover the text got underline and font gets bold on hover event. But now what I want to do is remove the hyperlink and apply the same effect bydefault i.e. not on hover. In short I want to apply the style currently applying on hover without hovering the text. My HTML and css code is as follows:

.faq .section p.quetn a:hover {
    text-decoration:underline;
    font-weight:bold
}
<p class="quetn"><a href="">5.14 Where do i see my test results?</a></p>

One more important thig is I can't change the above written CSS, I want to override the above CSS code by writing a new class. Can you help me in achieving this? Thanks in advance.

like image 700
PHPLover Avatar asked Sep 27 '13 10:09

PHPLover


1 Answers

Just use the same rule for when the link is not being hovered:

.faq .section p.quetn a, .faq .section p.quetn a:hover {
    text-decoration:underline;
    font-weight:bold
}

EDIT

Juse seen that you can't change the CSS for some reason.

Just create a new class with the same styles.

a.class, a.class:hover {
    text-decoration:underline;
    font-weight:bold
}

<a class="class" title="" href="#">Some Link</a>

EDIT v2

Do you want to style the text but remove the link markup?

It would just be

<p class="class">Text</p>

p.class {
    text-decoration:underline;
    font-weight:bold
}
like image 192
martincarlin87 Avatar answered Nov 02 '22 23:11

martincarlin87