'how to align the form to the right? [closed]
i am tying to have the h3 aligned with the form so the form goes to the right and the h3 to the left and both of them to be centered ?
<section style="background-color: #00CDCF; background-image: url(./images/services/contact.jpg);">
<div id="newsletterform">
<div class="wrap">
<h3 style="color:#EF7F1A;">Subscribe to our Newsletter</h3>
<form action="send.php" method="post" id="newsletter" name="newsletter"><input type="email" name="signup-email" id="signup-email" value="" placeholder="Insert email here" /><input type="submit" value="Subscribe" name="signup-button" id="signup-button">
<div id="response"></div>
</form>
</div>
</div>
</section>
Solution 1:[1]
use flex and learn more about flexbox
.wrap {
display: flex;
align-items: center;
justify-content: space-between;
}
<section style="background-color: #00CDCF; background-image: url(./images/services/contact.jpg);">
<div id="newsletterform">
<div class="wrap">
<h3 style="color:#EF7F1A;">Subscribe to our Newsletter</h3>
<form action="send.php" method="post" id="newsletter" name="newsletter"><input type="email" name="signup-email" id="signup-email" value="" placeholder="Insert email here" /><input type="submit" value="Subscribe" name="signup-button" id="signup-button">
<div id="response"></div>
</form>
</div>
</div>
</section>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | godfather |