Restrict content in a div to two lines only
up vote
-1
down vote
favorite
I have large text as in attached image
before applying CSS
As per requirment , need to restrict showing data to two lines only . For that I am using below css code
{ display: -webkit-box;
margin: 0 auto;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
white-space : normal;
width : 100%
}
After Applying Above CSS
But client is asking for output as below
Expecting ..
Please someone help on this
javascript html5 css3
|
show 1 more comment
up vote
-1
down vote
favorite
I have large text as in attached image
before applying CSS
As per requirment , need to restrict showing data to two lines only . For that I am using below css code
{ display: -webkit-box;
margin: 0 auto;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
white-space : normal;
width : 100%
}
After Applying Above CSS
But client is asking for output as below
Expecting ..
Please someone help on this
javascript html5 css3
Your statement is unclear, it looks like your container width is not long enough?
– Sing
Nov 20 at 7:14
Could you please explain the difference between the output you got and the client requirement. Apart from the extra ellipsis.
– vssadineni
Nov 20 at 10:00
Please be careful because-webkit-line-clamp, -webkit-box-orient
won't work in firefox and others. see caniuse.com/#feat=css-line-clamp
– Mihai T
Nov 20 at 13:17
Question has been modified , please help
– Swamy
Nov 21 at 9:13
Using ellipsis to "dot out" text only works for single lines.
– connexo
Nov 21 at 11:15
|
show 1 more comment
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have large text as in attached image
before applying CSS
As per requirment , need to restrict showing data to two lines only . For that I am using below css code
{ display: -webkit-box;
margin: 0 auto;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
white-space : normal;
width : 100%
}
After Applying Above CSS
But client is asking for output as below
Expecting ..
Please someone help on this
javascript html5 css3
I have large text as in attached image
before applying CSS
As per requirment , need to restrict showing data to two lines only . For that I am using below css code
{ display: -webkit-box;
margin: 0 auto;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
white-space : normal;
width : 100%
}
After Applying Above CSS
But client is asking for output as below
Expecting ..
Please someone help on this
javascript html5 css3
javascript html5 css3
edited Nov 21 at 11:11
asked Nov 20 at 6:09
Swamy
1817
1817
Your statement is unclear, it looks like your container width is not long enough?
– Sing
Nov 20 at 7:14
Could you please explain the difference between the output you got and the client requirement. Apart from the extra ellipsis.
– vssadineni
Nov 20 at 10:00
Please be careful because-webkit-line-clamp, -webkit-box-orient
won't work in firefox and others. see caniuse.com/#feat=css-line-clamp
– Mihai T
Nov 20 at 13:17
Question has been modified , please help
– Swamy
Nov 21 at 9:13
Using ellipsis to "dot out" text only works for single lines.
– connexo
Nov 21 at 11:15
|
show 1 more comment
Your statement is unclear, it looks like your container width is not long enough?
– Sing
Nov 20 at 7:14
Could you please explain the difference between the output you got and the client requirement. Apart from the extra ellipsis.
– vssadineni
Nov 20 at 10:00
Please be careful because-webkit-line-clamp, -webkit-box-orient
won't work in firefox and others. see caniuse.com/#feat=css-line-clamp
– Mihai T
Nov 20 at 13:17
Question has been modified , please help
– Swamy
Nov 21 at 9:13
Using ellipsis to "dot out" text only works for single lines.
– connexo
Nov 21 at 11:15
Your statement is unclear, it looks like your container width is not long enough?
– Sing
Nov 20 at 7:14
Your statement is unclear, it looks like your container width is not long enough?
– Sing
Nov 20 at 7:14
Could you please explain the difference between the output you got and the client requirement. Apart from the extra ellipsis.
– vssadineni
Nov 20 at 10:00
Could you please explain the difference between the output you got and the client requirement. Apart from the extra ellipsis.
– vssadineni
Nov 20 at 10:00
Please be careful because
-webkit-line-clamp, -webkit-box-orient
won't work in firefox and others. see caniuse.com/#feat=css-line-clamp– Mihai T
Nov 20 at 13:17
Please be careful because
-webkit-line-clamp, -webkit-box-orient
won't work in firefox and others. see caniuse.com/#feat=css-line-clamp– Mihai T
Nov 20 at 13:17
Question has been modified , please help
– Swamy
Nov 21 at 9:13
Question has been modified , please help
– Swamy
Nov 21 at 9:13
Using ellipsis to "dot out" text only works for single lines.
– connexo
Nov 21 at 11:15
Using ellipsis to "dot out" text only works for single lines.
– connexo
Nov 21 at 11:15
|
show 1 more comment
1 Answer
1
active
oldest
votes
up vote
0
down vote
Your code is ok.
you will have to define width as you need.
{
display:-webkit-box;
-webkit-line-clamp:3;
-webkit-box-orient:vertical;
overflow: hidden;
width: 160px;
}
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Your code is ok.
you will have to define width as you need.
{
display:-webkit-box;
-webkit-line-clamp:3;
-webkit-box-orient:vertical;
overflow: hidden;
width: 160px;
}
add a comment |
up vote
0
down vote
Your code is ok.
you will have to define width as you need.
{
display:-webkit-box;
-webkit-line-clamp:3;
-webkit-box-orient:vertical;
overflow: hidden;
width: 160px;
}
add a comment |
up vote
0
down vote
up vote
0
down vote
Your code is ok.
you will have to define width as you need.
{
display:-webkit-box;
-webkit-line-clamp:3;
-webkit-box-orient:vertical;
overflow: hidden;
width: 160px;
}
Your code is ok.
you will have to define width as you need.
{
display:-webkit-box;
-webkit-line-clamp:3;
-webkit-box-orient:vertical;
overflow: hidden;
width: 160px;
}
edited Nov 21 at 7:42
answered Nov 20 at 7:19
Ashu
12
12
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53387188%2frestrict-content-in-a-div-to-two-lines-only%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Your statement is unclear, it looks like your container width is not long enough?
– Sing
Nov 20 at 7:14
Could you please explain the difference between the output you got and the client requirement. Apart from the extra ellipsis.
– vssadineni
Nov 20 at 10:00
Please be careful because
-webkit-line-clamp, -webkit-box-orient
won't work in firefox and others. see caniuse.com/#feat=css-line-clamp– Mihai T
Nov 20 at 13:17
Question has been modified , please help
– Swamy
Nov 21 at 9:13
Using ellipsis to "dot out" text only works for single lines.
– connexo
Nov 21 at 11:15