Create An HTML Page To Place 4 Div Elements Si...
Create An HTML Page To Place 4 Div Elements Si...
home / study / engineering / computer science / computer science questions and answers / 12. create an html page to place 4 div elements side-b…
Question: 12. Create an HTML page to place 4 div elements side-by-side… Post a question
Answers from our experts for your tough
homework questions
Enter question
Continue to post
20 questions remaining
Code:
<!DOCTYPE html>
<html> My Textbook Solutions
<head>
<style>
*{
box-sizing: border-box;
}
Sampling Chemistry Bioproc
/* create columns to get horizontally */ 2nd Edition 10th Edition Enginee
.columndiv { 2nd Editi
oat: left;
View all solutions
width: 25%;
padding: 10px;
/*height: 300px; */
}
/* remove oating*/
.rowdiv:after {
content: "";
display: table;
clear: both;
}
</style>
</head>
<body>
<div class="rowdiv">
<div class="columndiv" style="font-size:35px;
color:red;
font-family:Arial;
height: 125px;
width: 125px;
border-style: solid;
border-color:black;
text-align:center;">
<h7>Uno</h7>
</div>
<div class="columndiv" style="font-size:35px;
color:red;
font-family:Arial;
height: 125px;
width: 125px;
border-style: solid;
border-color:black;
text-align:center;">
<h7>Dos</h7>
</div>
Textbook Solutions Expert Q&A Study Pack Practice
</div>
<div class="columndiv" style="font-size:35px;
color:red;
font-family:Arial;
height: 125px;
width: 125px;
border-style: solid;
border-color:black;
text-align:center;">
<h7>Cuatro</h7>
</div>
</div>
</body>
</html>
Output:
Explanation:
The output is achieved with the help of CSS. Usually <div> tag aligns content in column. In order to align
horizontally, we need to use CSS and also have a container <div> and place the required 4 div inside the
container. The styles given in the question are given or repeated in 4 <div> tags and new CSS called
"rowdiv" and "columndiv" are used to display div horizontally.
Comment
See answer
COMPANY
CHEGG NETWORK
CUSTOMER SERVICE Textbook Solutions Expert Q&A Study Pack Practice