Just reaching out with a question regarding my coding process.
Currently, I am in the midst of translating the website's navigation design into code. The attached image showcases the navigation layout consisting of 10 rows and 8 columns. Below is a snippet of the code I have written for this.
The issue I am encountering is that the height setting value of 10% is not being applied when there is no text present. I would greatly appreciate guidance on how to rectify this problem.
Furthermore, I must admit that I am not well-versed in coding. Therefore, if possible, could you provide me with a specific code example to address this issue?
Thank you in advance for your assistance.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
box-sizing: border-box;
}
body {margin-top: 0; margin-left: 0; margin-right: 0;}
/* Create four equal columns that floats next to each other */
.column {
float: left;
width: 12.5%;
padding: 0;
height: 10%/* Should be removed. Only for demonstration */
}
.logo {
float: left;
width: 12.5%;
padding: 0;
height: 20%/* Should be removed. Only for demonstration */
}
.column2 {
float: right;
width: 87.5%;
padding: 0;
margin: 0;
height: 10%; /* Should be removed. Only for demonstration */
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
margin-top: 0;
}
</style>
</head>
<body>
<div class="row">
<div class="logo" style="background-color:#aaa;">
<h2>Column 1</h2>
</div>
<div class="column" style="background-color:#bbb;">
<h2>Column 2</h2>
</div>
<div class="column" style="background-color:#ccc;">
<h2>Column 3</h2>
</div>
<div class="column" style="background-color:#ddd;">
<h2>Column 4</h2>
</div>
<div class="column" style="background-color:#ddd;">
<h2>Column 5</h2>
</div>
<div class="column" style="background-color:#ddd;">
<h2>Column 6</h2>
</div>
<div class="column" style="background-color:#ddd;">
<h2>Column 7</h2>
</div>
<div class="column" style="background-color:#ddd;">
<h2>Column 8</h2>
</div>
<div class="column2" style="background-color:#ddd;">
<h2>Column 8</h2>
</div>
</div>
</body>
</html>