How to remove underline in links in wordpress?

15,276

Solution 1

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

Solution 2

I have just discovered that WordPress adds a box-shadowto some of its tags.

a {
  text-decoration: none !important;
  box-shadow: none !important;
}

Solution 3

Its not the h1 that has the underline, it is the a tag sitting underneath it. So, try

h1 a{
   text-decoration:none;
}
Share:
15,276
Mr.Pandya
Author by

Mr.Pandya

Updated on June 14, 2022

Comments

  • Mr.Pandya
    Mr.Pandya almost 2 years

    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;
    }.
    
  • jasie
    jasie almost 3 years
    This only works, if the underline is caused by a set border-bottom! Usually, it is caused by text-decoration: underline (which is also browser default style).