<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>CSS Demo</title> <link rel="stylesheet" href="styles.css"> <!-- Link to external CSS --> <style> /* Internal CSS */ h2 { color: green; text-align: center; } </style> </head> <body> <h1 style="color: blue; text-align: center;">Welcome to CSS Demo</h1> <!-- Inline CSS --> <h2>Internal CSS Example</h2> <p>This paragraph demonstrates the use of internal CSS for styling headings.</p> <h2 style="color: orange;">Inline CSS Example</h2> <p>This paragraph is styled using inline CSS for the heading.</p> <h2 class="external-header">External CSS Example</h2> <p>This paragraph demonstrates the use of external CSS for styling.</p> </body> </html> /* External CSS */ body { background-color: #f4f4f4; font-family: Arial, sans-serif; } .external-header { color: purple; text-align: center; }
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