I am wondering how I would be able to make this more semantic. My initial thought was change the <div class="container">
to a <main>
and style that, and change the <div class="content">
to a <section>
, but I’m not sure what would be best. Any resources to help understand semantic HTML are greatly appreciated as well. Thanks!
<body>
<div class="container">
<div class="content">
<h1>Responsive layouts don't have to be a struggle</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
magna
aliqua. Ut enim ad minim veniam.</p>
<button class="cta-btn">I want to learn</button>
</div>
</div>
</body>
And my CSS here:
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700;900&display=swap');
*, *::before, ::after {
box-sizing: border-box;
padding: 0;
margin: 0;
}
body {
font-family: 'Roboto', sans-serif;
}
.container {
width: 100%;
max-width: 1440px;
margin: 0 auto;
background-color: #23424A;
color: white;
}
.content {
width: 50%;
padding: 148px 0 148px 122px;
}
.content h1 {
font-weight: 900;
font-size: 48px;
margin-bottom: 1rem;
}
.content p {
font-size: 21px;
line-height: 31px;
margin-bottom: 3rem;
color: #DEE2E5;
}
.cta-btn {
border: none;
border-radius: 31.5px;
background-color: #38CFD9;
color: #23424A;
padding: 16px 48px;
text-transform: uppercase;
font-weight: 700;
font-size: 21px;
}
.cta-btn:hover {
background-color: #32bac3;
cursor: pointer;
}