Why do I get these hyphens?

后端 未结 1 1395
感动是毒
感动是毒 2021-01-23 06:59

I am trying to make 3 buttons using divs, and align them horizontally using percentages. I managed to do that, but I get these hyphens between the divs. The hyphens appear only

相关标签:
1条回答
  • 2021-01-23 07:42

    Those are not hyphens, but the default underline of your <a>elements.
    You can remove them with text-decoration: none; in your css

    a {
       text-decoration: none;
       }
    
    .home_buttons {
        width: 10%;
        height: 100px;
        display: inline-block;
        margin-right: 11%;
        margin-left: 11%;
        text-align: center;
        vertical-align: top;
        text-decoration: none;
        text-transform: uppercase;
        font-weight: bold;
        font-size: 90%;
    }
    <a href="www.google.com">
        <div class="home_buttons" id="book_app_button" >
            <p>book appointment now</p>
        </div>
    </a>
    <a href="www.facebook.com">
        <div class="home_buttons" id="order_cl_button" >
            <p>order contact lenses</p>
        </div>  
    </a>
    
    <a href="www.reddit.com">
        <div class="home_buttons" id="contact_us_button" >
            <p>contact us</p>
        </div>
    </a>

    0 讨论(0)
提交回复
热议问题