Short Notes on CSS
What is CSS? CSS is used to style HTML elements. It stands for Cascading Style Sheets . Ways to Apply CSS Inline CSS : Directly inside an element ( style="color: red;" ). Internal CSS : Inside <style> tags in <head> . External CSS : In a separate .css file and linked via <link> . CSS Syntax: selector { property: value; } e.g; h1 { color: blue; font-size: 20px; } CSS Selectors Types of Selectors: Universal ( * ) → * { margin: 0; } Element ( h1, p ) → p { color: green; } Class ( .class-name ) → .box { border: 1px solid black; } ID ( #id-name ) → #header { background: gray; } Group ( h1, p ) → h1, p { color: red; } Descendant ( div p ) → div p { font-size: 14px; } Child ( div > p ) → div > p { color: blue; } Adjacent ( h1 + p ) → h1 + p { margin-top: 10px; } CSS Box Model Understanding Box Model Components: Content → Actual text/image inside the element. Padding → Space around content. Border → Line around pa...