-
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 Image Styling involves using CSS properties to control the appearance, size, shape, and behavior of images on a webpage. This helps create visually appealing and responsive layouts.
Property | Description | Example |
---|---|---|
width |
Set image width | img { width: 100%; } |
height |
Set image height | img { height: 200px; } |
max-width |
Max width to keep image responsive | img { max-width: 100%; } |
border-radius |
Round image corners | img { border-radius: 10px; } |
object-fit |
How image fits into container (cover , contain ) |
img { object-fit: cover; } |
box-shadow |
Add shadow effects | img { box-shadow: 0 4px 8px rgba(0,0,0,0.3); } |
filter |
Apply effects like blur, grayscale | img { filter: grayscale(50%); } |
opacity |
Set transparency | img { opacity: 0.8; } |
border |
Add borders | img { border: 2px solid black; } |
float |
Position image left or right | img { float: right; } |
img.profile {
width: 150px;
height: 150px;
border-radius: 50%;
object-fit: cover;
box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
object-fit
Worksfill
: Default, stretches image to fill container
cover
: Fills container, cropping if necessary
contain
: Fits inside container, preserving aspect ratio
none
: Original size
scale-down
: Smaller of none
or contain
Q1. Make all images responsive with max-width 100%.
Q2. Create a circular profile picture with 100px diameter.
Q3. Add a 5px solid red border to images.
Q4. Apply a subtle shadow to product images.
Q5. Make images grayscale on hover.
Q6. Float images to the left with 10px margin.
Q7. Use object-fit: cover
on a fixed-size image container.
Q8. Set image opacity to 0.7 on hover.
Q9. Add rounded corners of 15px radius to all images.
Q10. Use filter: blur(2px)
on background images.
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)