HTML Element Style How to - Keep div on one line and append ellipses


We would like to know how to keep div on one line and append ellipses.


<!DOCTYPE html>
<style type='text/css'>
.my-class-name {<!--from w  w  w .ja v a 2s.  c  om-->
  white-space: nowrap;
  text-overflow: ellipsis;
  width: 100px;
  overflow: hidden;
  <div class="my-class-name">Some really long text that I want
    gracefully truncated.</div>

The code above is rendered as follows: