
| Example Of Inline CSS Syntax |
| <p style="color: blue; font-size: 20px;"> </p> //This will give a blue color to paragraph with the font size of 20px. |
| Example Of Internal CSS Syntax |
| <head> <style> p { color: green; font-size: 18px; } </style> </head> |
| Example Of External CSS Syntax |
| <head> <link rel="stylesheet" href="styles.css"> </head> |
| p { font-size: 16px; color: blue; font-family: Arial, sans-serif; } //In this example, all paragraphs (`p` tags) on the web page will have a font size of 16 pixels, be colored blue, and use the Arial font.// |
| body { background-color: #f0f0f0; } header { background-image: url('PWSkills.jpg'); } //In this example, the website’s background color is set to a light gray, and the header section uses an image as its background.// |
| @media (max-width: 600px) { .container { flex-direction: column; } } //This example shows how CSS can change the layout to a single column when the screen width is less than 600 pixels, making it mobile-friendly.// |
| button { transition: background-color 0.3s ease; } button:hover { background-color: green; } |