The following HTML code showcases the structure of a front-end web developer's webpage:
<html>
<head>
<title>Front-end Web Developer</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<header class = "main-header clearfix">
<h1>Front-end Web Developer</h1>
<nav class = "main-nav">
<ul>
<li><a href = "index.html">Home</a></li>
<li><a href = "about.html">About</a></li>
<li><a href = "portfolio.html">Portfolio</a></li>
<li><a href = "contact.html">Contact</a></li>
</ul>
</nav>
</header>
</body>
</html>
Below is the [CSS] code responsible for styling the elements within the webpage:
body {
font-size: 32px;
background-color: rgb(30, 89, 152);
color: rgb(255, 255, 255);
font-family: Bookman, Georgia, serif;
}
.main-header {
border-style: solid;
border: 4px 2px;
border-color: rgb(255, 255, 255);
display: inline-block;
float: left;
}
h1 {
font-size: 2em;
margin: 0px 0px;
}
... (additional CSS properties)
.clearfix:after {
content: " ";
clear: both;
}
I have been struggling with adjusting padding, margins, and font sizes in the CSS to align the elements properly. I am unsure if my use of clearfix for clearing floats is causing the issue.
If anyone can provide insight into why the elements are not displaying on the same line, I would greatly appreciate it.
Thank you for your help.