CSS ONLY squared div in fluid layout
How do I make an css only squared div in fluid layout?
What is a css only squared div in fluid layout? How do you make a css only squared div in fluid layout? This script and codes were developed by Mirco Babini on 16 July 2022, Saturday.
CSS ONLY squared div in fluid layout - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CSS ONLY squared div in fluid layout</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="playground">PLAYGROUND</div>
<!-- first way -->
<div id="container"> <div id="element"> some text </div>
</div>
<!-- second way (better) -->
<div id="simpler"> text
</div>
</body>
</html>
CSS ONLY squared div in fluid layout - Script Codes CSS Codes
body{ max-width: 900px; border: 2px solid #ccc;
}
body .playground{ float: right; color: #000; margin: 10px 10px 0 0; color: #ccc;
}
#container { display: inline-block; width: 50%; background-color: red;
}
#element { width: 50%; height: 0; padding-bottom: 50%; background-color: silver;
}
#simpler{ background-color: green; height: 0; width: 50%; padding-bottom: 50%;
}
Developer | Mirco Babini |
Username | mircobabini |
Uploaded | July 16, 2022 |
Rating | 3 |
Size | 1,631 Kb |
Views | 34,408 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Forkable Sandbox for Ionic Templates | 3,865 Kb |
A Pen by Mirco Babini | 1,907 Kb |
Ionic Single Page Scrollable Sections with Tabs on Top by Mirco Babini | 3,148 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
SnappySnippet Test | Elmsoftware | 8,385 Kb |
Jochaho Skeleton | Dhanushbadge | 1,689 Kb |
Simple jQuery Slider | Jurbank | 2,874 Kb |
Animated Logo | Shakdaniel | 2,672 Kb |
Animate elements with fixed gradient | Badabam | 4,406 Kb |
Direction-icon | Alexandremasy | 3,323 Kb |
A Pen by Huan Nghiem | Nightshade | 10,646 Kb |
V.35 The Monolith Update - Hero Release Notes | Jordan | 12,045 Kb |
Coburg Banks SVG Logo | Mjtweaver | 3,875 Kb |
A Pen by tugce | Ecgutcnkr | 4,197 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!