Hello Everyone,
I know that questions similar to this one have been asked a million times but, after hours pouring through forums, CSS Tricks, etc., I cannot find a solution that works. I know that it is likely my noob understanding of CSS element alignment in general that is the issue but I have honestly tried multiple solutions with no success so I was hoping one of you “way better at this than myself” people could point me in the right direction.
I am practicing making a login page that contains only a logo image, input fields for UN and PW, and a login button. I have gotten everything to center both horizontally and vertically but I am sure the way that I have done it is less than elegant and it doesn’t resemble any of the solutions that I have been reading online. Also, I cannot seem to get the contents to scale with the window size.
Can you guys take a look at my code and let me know what the best way to center all elements on the login page both vertically and horizontally, and have them scale with window size would be? Like I said I have Googled for hours and each search reveals several different ways to do things, none of which actually worked when I tried it (because of my lack of understanding, not the solution I’m sure), and its just kind of overwhelming.
Thanks to anyone who may be able to provide some advice/insight!!
Ant
<div class="logo">
<img src="FwF2.png" alt="FwF Logo">
</div>
<div class="nav">
<div class="inputFieldLabels">
<p>Username</p>
<input type="text" name="Username" value="">
<p>Password</p>
<input type="password" name="Password" value="">
</div>
<div class="button">
<button type="button" name="Login">Login</button>
</div>
</div>
.inputFieldLabels, .logo {
text-align: center;
font-family: "Lucida Console" , monospace;
}
.button {
text-align: center;
margin-top: 20px;
font-family: "Lucida Console" , monospace;
}
body {
background-color: black;
}
p {
color: white;
}
img {
padding-top: 100px
{