Within this designated div, I have included:
https://i.stack.imgur.com/j099H.png
In an attempt to ensure that the font size of the text adjusts responsively, I implemented the following code:
font-size:calc(xx + 1.5vw);
However, upon resizing the screen, I noticed that the headers were not vertically aligned as desired:
https://i.stack.imgur.com/jl7KT.png
Here is the HTML snippet:
<div id="topsection">
<div id="header1">HEADER 1</div>
<div id="header2">Header 2</div>
</div>
And here is the corresponding CSS code:
#header1 {
margin-left:220px;
font-size:calc(20px + 1.5vw);
color:#fff;
}
#header2 {
color: #fff;
margin-left:220px;
font-size:calc(9px + 1.5vw);
}
#topsection {
background-color:#222939;
width:100%;
height:75px;
z-index:1;
position:absolute;
top:10px;
left:0;
color:white;
}
To address the issue with vertical alignment, I made adjustments to the CSS for the headers, as shown below:
#header1 {
display: inline-block;
vertical-align: middle;
margin-left:220px;
font-size:calc(20px + 1.5vw);
color:#fff;
}
#header2 {
display: inline-block;
vertical-align: middle;
margin-left:220px;
font-size:calc(9px + 1.3vw);
color: #fff;
}
Unfortunately, the result now appears like this: