Reputation: 99
I want my text to be underlined when it's active but when I did it looks like this:
I just only want the text to get underlined, if I used text-decoration:underline
it underline the word but the I don't know how to make a gap between the text and the underline. I added new class .currents
.
Here is my code:
<header id="header" class="transparent-header" data-sticky-class="not-dark">
<div id="header-wrap" style="height:180px;">
<!-- Primary Navigation
============================================= -->
<nav id="primary-menu" class="style-2 center">
<div id="primary-menu-trigger">
<i class="icon-reorder"></i>
</div>
<div style="text-align:center">
<ul class="one-page-menu" data-easing="easeInOutExpo" data-speed="1250" data-offset="65">
<li>
<a href="index.html"><div>Home</div></a>
</li>
<li>
<a href="about.html"><div>WHO WE ARE</div></a>
</li>
<li>
<a href="products.html"><div>WHAT WE TRADE</div></a>
</li>
<li>
<a href="services.html"><div>SERVICES</div></a>
</li>
<li class="currents">
<a href="logistic.html"><div>LOGISTICS</div></a>
</li>
<li>
<a href="contact.html"><div>CONTACT</div></a>
</li>
</ul>
</div>
</nav><!-- #primary-menu end -->
<br>
</div>
</header><!-- #header end -->
CSS:
.currents {
height: 3em;
border-bottom: 1px solid ;
/* margin-bottom: 5px;*/
}
Here is the working jsfiddle. Thanks in advance
https://jsfiddle.net/light22/atzL4ahu/#&togetherjs=eLF0v1iEs8
Upvotes: 0
Views: 517
Reputation: 1604
You could wrap the text in a <span>
tag. Here's a working JSFiddle demonstrating this.
https://jsfiddle.net/j7wo5pxx/
Upvotes: 1
Reputation: 29277
You can use border-bottom
(instead of text-decoration:underline
) and padding-bottom
to achieve your wish.
Like this:
a {
text-decoration:none;
display:inline-block;
border-bottom: 1px solid;
}
.gap {
padding-bottom:15px;
}
<a href="#">without gap</a>
<a href="#" class="gap">with gap</a>
Upvotes: 2