How to remove underline in links in wordpress? - wordpress

I am new to wordpress theme development.I tried well but not getting right .how to remove underline from links.
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url')?>">
<h1 calss="vijay">
<?php wp_loginout('www.google.co.in')?>
</h1>
css file.
h1{
color:red;
text-decoration: none;
}.

I have just discovered that WordPress adds a box-shadowto some of its tags.
a {
text-decoration: none !important;
box-shadow: none !important;
}

Hyperlinks are governed by anchor tags <a> hence you have to use a in
your css link this
h1 a {
text-decoration: none;
}
you can refer to W3School

Its not the h1 that has the underline, it is the a tag sitting underneath it. So, try
h1 a{
text-decoration:none;
}

a{
text-decoration: none;
}
Copy This code & past in Your CSS file

The best option, tested and trusted is just to add this code in the customization tab.
a {
border-bottom: none !important;
}
And the error is gone.

Related

Remove Underline on Hover

I've tried everything I could to remove the underline that appears when hovering over a product title on my Shopify. Any css suggestions as to how I can remove this underline anywhere that a product title appears?
Thank you!!!
**Try these two**
a:link {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
Yeah. I had encountered this issue before. Just use below code snippet:
.site-nav__link:hover span.site-nav__label { border-bottom: none; }
From my code snippet. Just replace it with your div

How to disable text decoration with CSS?

So, I need to remove a visited link coloring from my navigation bar, as it will look ugly.
I have tried to use text-decoration: none; and color: white; but that does not seem to help it.
CSS for navigation
Actual code
I removed the actual links from the code, in the real version there is link but for this question links are replaced with #
In addition to Bariock's answer, this will help reset your <a> links in all circumstances to your specified css.
a:visited, a:hover, a:active, a:focus {
color: yourColor !important;
text-decoration: none !important;
outline: none !important;
}
The !important signifies that it has a higher precedence than that of other rules declaring the same values for the same selectors. Note: you can still style them separately such like you would with :hover.
a:visited{
color: your-color;
}
I edited the <a> tag to go around the <button> so the text is back to white now and the button actually works. It is no longer just "click text to visit link" the whole button works.
<button class="dropbtn">Community</button>
Try adding a !important to the end of the css styles like so:
a {
color: white !important;
}
Hope this helps!
I recommend you first set the style of the link tag, for example:
.dropdown a{ color:#fff }
now your text links inside the container with the class .dropdown will be as white color. Then you don't need to set a visited link color, unless you want to set it.
If you want to get rid the underline in the link, your style will be like this:
.dropdown a{ color:#fff; text-decoration: none; }

Easy way to style link colour separate from a:link

I am currently using:
a:link {
color: #FF0000;
text-decoration: underline;
}
But on a certain page in my website I want to be able to have my links in a separate colour.
What is the best way to do this through CSS?
I don't want to do:
<font color="#00FF00">...</font>
As i know this is deprecated code
Add a class to every link you want to affect:
HTML: Link
Then add this CSS or similar to your style sheet:
CSS: a.alternate {color:#00FF00;} //or whatever
Demo: http://codepen.io/hwg/pen/Aalkb
apply different class attribute to that link. for ex:
HTML
link1
link2
CSS
a:link {
text-decoration: underline;
}
.red{
color: #FF0000;
}
.black{
color: #000000;
}
see this Fiddle

Text decoration for link and span inside this link

I have links like:
Link text<span>Link sub-text</span>
When hovering I need that text inside span is not decorated with underline (but main link text is). Is it possible?
I've tried:
a:hover span {text-decoration:none;}
This is not working.
Is there any solution for this?
Add link text (text you want to be decorated with underline) inside <span> and the sub-text outside as normal link text, like:
<span>Link text</span>sub-text
To decorate Link text use:
a:hover {
text-decoration:none;
}
a:hover span {
text-decoration:underline;
}
A simple solution is to use the color and border properties, instead of text-decoration. You need to set text-decoration: none first, and then use border-bottom as the underline for all your links.
style.css
a, a:link, a:visited
{
color: #11bad3;
text-decoration: none;
border-bottom: 1px solid #11bad3;
}
a:hover, a:active
{
background: #00a9c2;
border-color: #00a9c2;
color: #fff;
}
print.css
a, a:link, a:visited
{
border-bottom: 0px;
}
index.html
<link rel="stylesheet" href="assets/css/style.css" type="text/css" media="all">
<link rel="stylesheet" href="assets/css/print.css" type="text/css" media="print">
I know this is an old post, but since I just had the same problem, and came up with a solution, I figured I would write it anyways.
Instead of trying using text-decoration: underline, instead just use border-bottom: 1px solid #000, this way, you can simply say border-bottom: none,
Another solution is to use colors instead of underlines as your identifier:
<a id="outer-link" href="#">
Outer text <span id="inner-text">inner text</span> more outer text.
</a>
<style>
a { text-decoration: none; }
#outer-link:hover { color: green; }
#outer-link:hover #inner-text { color: red; }
</style>

css and underline

Why is the link using the underline?
<html>
<head>
<style type="text/css">
body{
text-decoration: underline;
}
#text{
text-decoration: none;
}
</style>
</head>
<body>
Text text text <br/>
<div id = "text">
link
</div>
</body>
</html>
Because this is the default (user agent css have this rule, to apply underline in every tag a). The default isn't inherit, so even if parent tag has underline, the child won't get it.
EDIT 1:
For example, firefox have this rule:
*|*:-moz-any-link {
text-decoration:underline;
}
Default would be:
*|*:-moz-any-link {
text-decoration:inherit;
}
Then, in your example, the tag a would inherit div text-decoration.
EDIT 2:
You can overwrite default behavior with:
a {
text-decoration: inherit;
}
It's the default behavior of the a tag. It doesn't match the #text style.
I think you want to replace this...
#text{
text-decoration: none;
}
with this...
#text a:link{
text-decoration:none;
}
this tells the rule to apply to all anchors that are children of the tag who's id is 'text'
It's included in the default browser CSS. It's just as if this was included prior to your style tag:
a{
text-decoration: underline;
}
Sure, the link also matches #text, but since a is more specific, it wins. Any attributes not explicitly specified by the browser's a (such as font-size) will be inherited.

Resources