force div contents to stay in one line - HTML CSS CSS Property

HTML CSS examples for CSS Property:word-wrap

Description

force div contents to stay in one line

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.js"></script> 
  <style id="compiled-css" type="text/css">

div {<!--from  w  w w  .  j a  v a 2 s .  com-->
   border: 1px solid black;
   width: 70px;
   white-space:nowrap;
}


      </style> 
 </head> 
 <body> 
  <div>
    this is a test! this is a test! this is a test! this is a test! 
    this is a test! this is a test! this is a test! this is a test! 
    this is a test! this is a test! this is a test! this is a test! 
  </div>  
 </body>
</html>

Related Tutorials