-
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)
Responsive Web Design (RWD) is a web development approach that allows your website or web application to look good on all devices — desktops, laptops, tablets, and smartphones — without the need for separate mobile sites.
It uses flexible layouts, media queries, fluid grids, and responsive images to automatically adjust the layout based on screen size, orientation, and resolution.
✔️ One website for all devices
✔️ Better user experience on any screen
✔️ Improved SEO (Google prioritizes mobile-friendly websites)
✔️ No need for separate mobile versions
✔️ Faster maintenance and cost-effective
Fluid Grid Layouts
Uses relative units like %
instead of fixed units like px
.
.container {
width: 100%;
}
Flexible Images
Images scale within their parent containers using max-width.
img {
max-width: 100%;
height: auto;
}
Media Queries
CSS rules that apply at specific screen sizes or conditions.
@media (max-width: 768px) {
body {
font-size: 14px;
}
}
<div class="container">
<div class="box">Box 1</div>
<div class="box">Box 2</div>
</div>
.container {
display: flex;
flex-wrap: wrap;
}
.box {
flex: 1 1 50%;
padding: 20px;
}
@media (max-width: 600px) {
.box {
flex: 1 1 100%;
}
}
📱 On desktop: 2 boxes side-by-side
📲 On mobile: Boxes stack vertically
✅ Write CSS or HTML for the following:
Q1. Create a fluid layout using percentage widths.
Q2. Write media query for screens smaller than 768px.
Q3. Make an image scale within its container.
Q4. Stack two columns into one on smaller screens.
Q5. Make a button full-width only on mobile.
Q6. Use flex-wrap
to wrap items responsively.
Q7. Set font-size to be smaller on mobile devices.
Q8. Hide a sidebar on screens less than 500px wide.
Q9. Align menu items horizontally and collapse into a menu icon on small screens.
Q10. Create a responsive three-column layout that becomes single-column on phones.
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)