Search code examples
htmlcsshreftext-decorations

Why is there href decoration next to my div?


Why is there an underline after the text in the image below?

AOrUb92

<a href="index.html">
    <div style="display: inline-block">
        <img src="images/fallout.svg">
        <h1 class="header_text">Mods</h1>
    </div>
</a>
.header_text {
    display: inline-block;
    font-size: 20px;
    color: white; 
}

Solution

  • EDIT: revised my answer because I didn't understand the question.

    to get rid of underlines in hyperlinks, use the following code:

    #example {
     text-decoration: none;
    }
    

    hyperlinks have a text decoration of "underline" by default. You have to specify "none" to get rid of that.