Declaring a style sheet in the header section
<?xml version = "1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns = "http://www.w3.org/1999/xhtml"> <head> <title>Style Sheets</title> <style type = "text/css"> em { background-color: #8000ff; color: white } h1 { font-family: arial, sans-serif } p { font-size: 14pt } .special { color: blue } </style> </head> <body> <h1 class = "special">header 1.</h1> <p>this is a test. this is a test. this is a test. </p> <h1>Clients</h1> <p class = "special"> this is a test. <em>this is a test. </em>this is a test. </p> </body> </html>
1. | Embedded Style Sample | ||
2. | Two Embedded Style | ||
3. | Styling text with CSS | ||
4. | The style attribute allows you to declare inline styles. Separate multiple styles with a semicolon. | ||
5. | 'style' Example |