Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> CSS

Thuộc tính CSS white-space


Sử dụng thuộc tính white-space để xử lý khoảng trắng bên trong một phần tử:

Ví dụ

<!DOCTYPE html> <html>    <head>       <style>          p.demo1 {             white-space: normal;          }          p.demo2 {             white-space: pre;          }       </style>    </head>    <body>       <h2>Control white-space</h2>       <p class = "demo1">          This is demo text.          This is demo text.       </p>       <p class = "demo2">          This is demo text.          This is demo text.       </p>    </body> </html>