日期:2013-05-08  浏览次数:21950 次

DIV不换行的方法,如下代码:

  1. <html> 
  2. <head> 
  3. <title>DIV不换行的方法 - www.cxybl.com</title> 
  4. <style type="text/css"> 
  5. #bottom { 
  6.  margin:0 auto;/*下边居是0 */ 
  7.  width:300px; 
  8. } 
  9. #bottom div { 
  10.  width:60px; 
  11. } 
  12. #d1 {  
  13.  float:left;  
  14.  background:#f00; 
  15. } 
  16. #d2 {  
  17.  float:right;  
  18.  background:#0f0; 
  19. } 
  20. #d3 {  
  21.  float:right;  
  22.  background:#00f; 
  23. } 
  24. #d4 {  
  25.  float:right;  
  26.  background:#00f; 
  27. } 
  28. #d5 {  
  29.  float:right;  
  30.  background:#00f; 
  31. } 
  32. </style> 
  33. </head> 
  34. <body> 
  35. <div id="bottom"> 
  36. <div id="d3">d3</div> 
  37. <div id="d1">d1</div> 
  38. <div id="d2">d2</div> 
  39. <