Reputation: 1437
NOTE : CSS Color not taking for anchor tag when using elipsis but taking same color which is using for main div class
CSS :
<style type="text/css">
.oneline {
text-overflow : ellipsis;
white-space : nowrap;
width : 50px;
overflow : hidden;
color: #f00;
}
a {color:#000;}
</style>
<div class="oneline">
Testing 123 Testing 456 Testing 789 <br/>
<a href="">Testing 123 Testing 456 Testing 789</a>
</div>
Upvotes: 0
Views: 313
Reputation: 26989
Try adding an extra element around text. Since you have given it to parent element it consider the ellipsis color as paretnt element text color.
HTML
<div class="oneline">
<span>Testing 123 Testing 456 Testing 789</span> <br/>
<a href="">Testing 123 Testing 456 Testing 789</a>
</div>
CSS
.oneline span, .oneline a {
display:block;
text-overflow : ellipsis;
white-space : nowrap;
width : 50px;
overflow : hidden;
color:#f00;
}
.oneline a {
color:#000
}
Upvotes: 1
Reputation: 248
You have set color black for all elements with 'a' tag.
To give a specific color to a specific element 'a' tag, use classname with 'a' tag and specify the color you want.
Upvotes: 0