-
Hajipur, Bihar, 844101
Hajipur, Bihar, 844101
CSS Basics
CSS Styling Properties
CSS Box Model
CSS Margin
CSS Padding
CSS Borders
CSS Outline
CSS Height/Width
CSS Max-width
CSS Display
CSS Position
CSS Z-index
CSS Overflow
CSS Float
CSS Inline-block
CSS Align
CSS Box Sizing
CSS Text
CSS Fonts
CSS Icons
CSS Text Effects
CSS Web Fonts
CSS Colors
CSS Backgrounds
CSS Color Keywords
CSS Gradients
CSS Shadows
CSS Links
CSS Lists
CSS Tables
CSS Advanced Selectors & Features
CSS Combinators
CSS Pseudo-classes
CSS Pseudo-elements
CSS Attribute Selectors
CSS Specificity
CSS !important
CSS Units
CSS Variables
CSS @property
CSS Math Functions
CSS Media and Image Styling
CSS Image Styling
CSS Image Centering
CSS Image Filters
CSS Image Shapes
CSS object-fit
CSS object-position
CSS Masking
CSS Layout Techniques
CSS Website Layout
CSS Navigation Bar
CSS Dropdowns
CSS Image Gallery
CSS Counters
CSS Pagination
CSS Multiple Columns
CSS User Interface
CSS Flexbox
CSS Grid
CSS Responsive Design (RWD)
CSS comments are used to explain your code or to temporarily disable part of your CSS.
They do not affect how the CSS runs and are completely ignored by the browser.
/* This is a comment */
Starts with /*
Ends with */
Can be placed on a separate line or inline with code
/* Set background color */
body {
background-color: lightgray;
}
p {
color: blue; /* Make text blue */
}
/*
h1 {
color: red;
}
*/
✅ The above rule will not apply because it’s inside a comment block.
To explain sections of your code
To organize long stylesheets
To debug by temporarily turning styles off
Q1. Add a comment before setting the text color of all <h1>
elements.
Q2. Add a comment above a rule that changes the font size of paragraphs.
Q3. Write a CSS rule for <body>
with a comment explaining the background color.
Q4. Add an inline comment to a rule that sets the color of <h2>
to red.
Q5. Write a comment to describe the purpose of a .box
class.
Q6. Temporarily disable a CSS rule that adds a border to all images.
Q7. Add a comment inside the CSS file explaining that a section is for buttons.
Q8. Comment out the entire CSS block for .card
.
Q9. Add a comment stating that a section of CSS applies only to the homepage.
Q10. Add a comment to explain why box-sizing: border-box;
is being used.
CSS Basics
CSS Styling Properties
CSS Box Model
CSS Margin
CSS Padding
CSS Borders
CSS Outline
CSS Height/Width
CSS Max-width
CSS Display
CSS Position
CSS Z-index
CSS Overflow
CSS Float
CSS Inline-block
CSS Align
CSS Box Sizing
CSS Text
CSS Fonts
CSS Icons
CSS Text Effects
CSS Web Fonts
CSS Colors
CSS Backgrounds
CSS Color Keywords
CSS Gradients
CSS Shadows
CSS Links
CSS Lists
CSS Tables
CSS Advanced Selectors & Features
CSS Combinators
CSS Pseudo-classes
CSS Pseudo-elements
CSS Attribute Selectors
CSS Specificity
CSS !important
CSS Units
CSS Variables
CSS @property
CSS Math Functions
CSS Media and Image Styling
CSS Image Styling
CSS Image Centering
CSS Image Filters
CSS Image Shapes
CSS object-fit
CSS object-position
CSS Masking
CSS Layout Techniques
CSS Website Layout
CSS Navigation Bar
CSS Dropdowns
CSS Image Gallery
CSS Counters
CSS Pagination
CSS Multiple Columns
CSS User Interface
CSS Flexbox
CSS Grid
CSS Responsive Design (RWD)