Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove extra space on right side with ellipsis

Tags:

html

css

I want to remove extra space on right side with ellipsis class.

.ellipsis{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}
div{
    float:left;
}
.clear {
clear:both
}
<div class="ellipsis">hsdhhgasdhgasdgj</div><div>asdasd</div>
<div class="clear"></div>
<div class="ellipsis">asdasdasd</div><div>asdadsas</div>
like image 868
akash Avatar asked Aug 13 '15 07:08

akash


People also ask

How do I get rid of extra space in HTML?

Normally, setting margin:0 and padding:0 for the html and body elements, like you have done, should be enough to remove all spacing around the page.

How do I get rid of spaces in CSS?

We can also remove white space by setting parent element font-size to 0 and child elements font-size to 17px .


1 Answers

.ellipsis{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
    float:left;
}

.clear {
    clear:both
}
<div class="ellipsis">Some Text</div><div>asdasd</div>
<div class="clear"></div>
<div class="ellipsis">Some Text</div><div>asdadsas</div>
like image 73
Jinto John Avatar answered Sep 28 '22 09:09

Jinto John