Looking for some assistance with centering the input elements in the top div of a simple Webshop I'm creating.
HTML/CSS
body {
margin: 0;
background: lightcyan;
}
.top {
position: fixed;
background: lightblue;
width: 100%;
}
.top img {
width: 80px;
float: left;
}
.top h1 {
float: left;
}
.top form {
float: right;
height: 100%;
}
.top form input {
display: block;
float: right;
}
<html>
<head>
<title>Webshop</title>
</head>
<body>
<div class="top">
<img src="ImageUsed.png">
<h1>Webshop Title</h1>
<form>
<input type="submit" value="register">
<input type="submit" value="login">
</form>
</div>
</body>
</html>
The alignment of the div
, img
, and h1
elements is on point, but I'm struggling to vertically center the two input
elements within the form
element inside the div
. Any suggestions on how to achieve this?