WD 21. UnderstandingFloat&Clear
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Aligment</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu&display=swap">
<style>
* {
box-sizing: border-box;
}
body {
font-family: 'Ubuntu', sans-serif;
}
.container {
width: 900px;
border: 3px solid purple;
margin: 33px auto;
background-color: sandybrown;
}
.item {
border: 3px solid grey;
margin: 12px 3px;
padding: 12px 3px;
background-color: rgb(248, 200, 200);
}
#fruit {
float: left;
width: 48%;
}
#computer {
float: right;
width: 48%;
}
#stationary {
/* float: left; */
/* clear: left; */
clear: both;
width: 100%;
}
p,
h3 {
/* text-align: right;
text-align: left;
text-align: center; */
text-align: justify;
}
h1 {
margin:23px auto;
width: 455px;
}
</style>
</head>
<body>
<div class="container">
<h1>Welcome to my store</h1>
<div id="fruit" class="item">
<h3>Fruits</h3>
<p id="fruitpara" class="para">Lorem ipsum dolor sit amet consectetur adipisicing elit. Exercitationem iste
corporis, autem quod totam laudantium fuga veritatis illo quia ea commodi saepe reprehenderit
consequuntur sint molestiae perspiciatis impedit laboriosam corrupti? Lorem ipsum dolor sit amet,
consectetur adipisicing elit. Quas, porro necessitatibus! Dolore aperiam animi voluptas, modi adipisci,
molestias debitis repellendus assumenda dolorem expedita pariatur saepe et nihil. Consequatur nulla
repudiandae ea itaque molestiae sequi?Lorem ipsum dolor sit amet.</p>
</div>
<div id="computer" class="item">
<h3>Computer</h3>
<p id="computerpara" class="para">Lorem ipsum dolor sit amet consectetur adipisicing elit. Exercitationem
iste corporis, autem quod totam laudantium fuga veritatis illo quia ea commodi saepe reprehenderit
consequuntur sint molestiae perspiciatis impedit laboriosam corrupti?Lorem ipsum dolor sit amet
consectetur adipisicing elit. Corrupti provident architecto voluptate molestiae debitis magnam amet
beatae, fugiat voluptatum velit ut corporis facere quod, qui, aspernatur adipisci ipsam nam accusantium
blanditiis error omnis veniam! Lorem ipsum dolor sit amet consectetur adipisicing elit. Officia, esse.
</p>
</div>
<div id="stationary" class="item">
<h3>Stationary</h3>
<p id="stationarypara" class="para">Lorem ipsum dolor sit amet consectetur adipisicing elit. Exercitationem
iste corporis, autem quod totam laudantium fuga veritatis illo quia ea commodi saepe reprehenderit
consequuntur sint molestiae perspiciatis impedit laboriosam corrupti?</p>
</div>
<div id="glasses" class="item">
<h3>Glasses</h3>
<p id="glassespara" class="para">Lorem ipsum dolor sit amet consectetur adipisicing elit. Exercitationem
iste corporis, autem quod totam laudantium fuga veritatis illo quia ea commodi saepe reprehenderit
consequuntur sint molestiae perspiciatis impedit laboriosam corrupti?</p>
</div>
</div>
</body>
</html>
#Output:
Comments
Post a Comment