8 Premium One Line Css Tips


 / Published in: CSS
 

URL: http://cssglobe.com/post/1392/8-premium-one-line-css-tips

  1. /* 1. Vertical centering with line-height */
  2. line-height:24px;
  3.  
  4.  
  5. /* 2. Prevent oversized content to break fixed width floated layouts */
  6. #main{
  7. overflow:hidden;
  8. }
  9.  
  10.  
  11. /* 3. Prevent line breaks in links */
  12. a{
  13. white-space:nowrap;
  14. }
  15.  
  16.  
  17. /* 4. Always show Firefox scrollbar */
  18. html{
  19. overflow:-moz-scrollbars-vertical;
  20. }
  21.  
  22.  
  23. /* 5. Centering block elements horizontally */
  24. margin:0 auto;
  25.  
  26.  
  27. /* 6. Remove vertical textarea scrollbar in IE */
  28. textarea{
  29. overflow:auto;
  30. }
  31.  
  32.  
  33. /* 7. Force page breaks when printing your document */
  34. h2{
  35. page-break-before:always;
  36. }
  37.  
  38.  
  39. /* 8. Remove active link borders */
  40. a:active, a:focus{
  41. outline:none;
  42. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: SmpleJohn on April 11, 2008

I like it. Some helpful hints in there. Thanks.

Posted By: jonhenshaw on April 11, 2008

Excellent list. Thanks for posting it.

Posted By: Semmu on August 2, 2010

nice and useful codes. thank you.

You need to login to post a comment.