Hello,
So this is something I came across when trying to align a h2 and a form at the same time.
Here is my html .
<div class="sub-box">
<h2>Get all the Latest Gaming News Here</h2>
<form action="https://www.freecodecamp.com/email-submit" id="form">
<input type="email" name="subscribe" placeholder="Enter your email address">
<button id="submit" type="submit">Subscribe</button>
</form>
</div>
Here is my css.
/*sub box */
/*---doesn't work---
.sub-box {
text-align: center;
}
*/
.sub-box h2,
form {
text-align: center;
}
If I add text-align to my sub-box class in the chrome inspector it works fine. For some reason in my script it doesn’t. I tried finding an answer but can’t seem to find one or at least not in this css case.
Thanks for any help, feel free to direct me to some resources for better explanations.