I am using a slider that I can't modify the navigation text (next / previous) but I would like to replace the text with an arrow
I have added the arrows with the following css:
#carousel .hero-carousel-nav .prev a:after {
font-family: "Glyphicons Halflings";
color:#FFF;
content: "\e079";
}
#carousel .hero-carousel-nav .next:after {
font-family: "Glyphicons Halflings";
color:#FFF;
content: "\e080";
}
If I add the following CSS the arrow and text disappears
#carousel .hero-carousel-nav .prev a {
text-indent:-9999px;
}
I want to keep the arrow but remove the text, is this possible?
THe HTML structure for the navigation is:
<ul class="hero-carousel-nav">
<li class="prev">
<a href="#">
Previous
</a>
</li>
</ul>
The padding-left:0 is used to remove indentation (space) from left.
By using text-indent: -999px; or a similar method, the text is still there — just not visually there. Use display:none , and the text is gone.
You can use the CSS text-indent property to indent text in any block container, including divs, headings, asides, articles, blockquotes, and list elements. Say you want to indent all div elements containing text on a page to the right by 50px. Then, using the CSS type selector div, set the text-indent property to 50px.
The overflowing content can be clipped, display an ellipsis ('…'), or display a custom string. Syntax: text-overflow: clip|string|ellipsis|initial|inherit; Property Values: All the properties are described well with the example below.
By defaut, pseudo element are inline
element and follow text-indent
.
If you make it, float
or a block
boxe , it will stay in view.
Then you still need to reset to it text-indent
to 0;
it can be then :
#carousel .hero-carousel-nav .next:after {
font-family: "Glyphicons Halflings";
color:#FFF;
content: "\e080";
float:left;/* or display:block */
text-indent:0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With