HTML CSS examples for CSS:Introduction
The styles.css File
a { background-color:grey; color:white } span { border: thin black solid; padding: 10px; }
Importing an External Stylesheet
<!DOCTYPE HTML> <html> <head> <title>Example</title> <link rel="stylesheet" type="text/css" href="styles.css"></link> </head> <body> <a href="http://java2s.com">Website</a> <p>I like <span>CSS</span> and HTML.</p> <a href="http://w3c.org">Visit the W3C website</a> </body> </html>