
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS Responsive
- CSS - Responsive Web Design
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
How to create a responsive zig zag (alternating) layout with CSS?
To create responsive zig zag layout with CSS, the code is as follows −
Example
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> * { box-sizing:border-box; } body { margin: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } div h1{ font-size: 40px; color: blueviolet; text-align: center; } div p{ font-size: 18px; } .container { padding: 64px; } .row:after { content: ""; display: table; clear: both } .width66 { float: left; width: 66.66666%; padding: 20px; height: 471px; } .width33 { float: left; width: 33.33333%; padding: 20px; height: 471px; } .large-font { font-size: 48px; } .xlarge-font { font-size: 64px } .button { border: none; color: white; padding: 14px 28px; font-size: 16px; cursor: pointer; background-color: #4CAF50; } img { display: block; height: 250px; width: 250px; max-width: 100%; } @media screen and (max-width: 1000px) { .width66, .width33 { width: 100%; text-align: center; } img { margin: auto; } } </style> </head> <body> <h1 style="text-align:center">Responsive Zig Zag Layout Example</h2> <div class="width66"> <h1>A Gypsy</h1> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia tempore expedita sequi consequuntur rerum quasi voluptate deleniti iure quae magni qui, laudantium illo dolorum temporibus, dolor labore, quos eos. Dolores?</p> </div> <div class="width33"> <img src="https://i.picsum.photos/id/551/800/800.jpg"> </div> <div class="width33"> <img src="https://i.picsum.photos/id/211/800/800.jpg" alt="App"> </div> <div class="width66"> <h1>A cruise ship</h1> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia tempore expedita sequi consequuntur rerum quasi voluptate deleniti iure quae magni qui, laudantium illo dolorum temporibus, dolor labore, quos eos. Dolores?</p> </div> <div class="width66"> <h1>Natures View</h1> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia tempore expedita sequi consequuntur rerum quasi voluptate deleniti iure quae magni qui, laudantium illo dolorum temporibus, dolor labore, quos eos. Dolores?</p> </div> <div class="width33"> <img src="https://i.picsum.photos/id/251/800/800.jpg" > </div> </div> </div> </body> </html>
Output
The above code will produce the following output −
On resizing ourscreen −
- Related Articles
- How to create a responsive blog layout with CSS?
- How to create a responsive header with CSS?
- How to create a responsive image with CSS?
- How to create a responsive form with CSS?
- How to create a responsive table with CSS?
- How to create a responsive "timeline" with CSS?
- How to create responsive typography with CSS?
- How to create responsive testimonials with CSS?
- How to create a responsive image gallery with CSS
- How to create a responsive login form with CSS?
- How to create a responsive checkout form with CSS?
- How to create a responsive inline form with CSS?
- How to create a responsive pricing table with CSS?
- Create a responsive pagination with CSS
- How to create responsive floating elements with CSS?

Advertisements