w3resource
HTML exercises

CSS Properties: How to use text-overflow property

Go to Exercise page

Solution:

HTML Code:

<!DOCTYPE html>
  <html>
  <head>
  <title>How to use text-overflow property</title>
  <style type="text/css">
#div1 {
  white-space: nowrap;
  width: 100%;
  overflow: hidden; 
  text-overflow: ellipsis;
  border: 1px solid #FF0000;
  }
#div2 {
  white-space: nowrap;
  width: 100%;
  overflow: hidden; 
  text-overflow: clip;
  border: 1px solid #FF0000;
  }
</style>
  </head>
  <body>
  <h2><strong>w3resource Tutorial</strong></h2>
<p>Text overflow: ellipsis</>
<div id ="div1">CSS, stands for Cascading Style Sheet is a computer language to describe presentation (for example width, height, color, background color, alignment etc.) of HTML and XML (and XML based languages like XHTML, SVG) web documents. In all the examples of our tutorials, we have used HTML for implementing CSS.CSS, stands for Cascading Style Sheet is a computer language to describe presentation (for example width, height, color, background color, alignment etc.) of HTML and XML (and XML based languages like XHTML, SVG) web documents.</div>

<p>Text overflow: clip</>
<div id ="div2">CSS, stands for Cascading Style Sheet is a computer language to describe presentation (for example width, height, color, background color, alignment etc.) of HTML and XML (and XML based languages like XHTML, SVG) web documents. In all the examples of our tutorials, we have used HTML for implementing CSS.CSS, stands for Cascading Style Sheet is a computer language to describe presentation (for example width, height, color, background color, alignment etc.) of HTML and XML (and XML based languages like XHTML, SVG) web documents.</div>

  </body>
  </html>

Live Demo:

See the Pen text-overflow-answer by w3resource (@w3resource) on CodePen.


See the solution in the browser

Supported browser

Firefox logo Chrome logo Opera logo Safari logo Internet Explorer logo
YesYesYesYesYes

Go to Exercise page

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming


bedava porno