HTML: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>External Style Sheet Example</title> <link rel="stylesheet" href="styles.css"> </head> <body> <div id="main-content"> <h1>Welcome to External CSS Styling</h1> <p>This is an example of an external style sheet. The styles are stored in a separate file named <code>styles.css</code>.</p> <p class="highlight">This paragraph has additional styling with a specific class.</p> </div> </body> </html> CSS: /* styles.css */ body { font-family: Arial, sans-serif; background-color: #f0f0f0; margin: 0; padding: 0; } h1 { color: #333; text-align: center; padding: 20px; } p { color: #666; font-size: 18px; line-height: 1.6; margin: 20px; } .highlight { color: #0056b3; font-weight: bold; } #main-content { padding: 40px; background-color: #ffffff; border: 1px solid #ddd; max-width: 800px; margin: 20px auto; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter