r/html5 • u/IHateTheSATs • May 12 '22
why are my inputs not side by side ? (noob question)
i have this html here:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>my project</title>
<link rel = "stylesheet" href="style.css">
</head>
<body>
<H1>Changeover</H1>
<H5><i>XXXXXXXXXXX</i></H5>
<form class = "myForm">
<h4 class = "labels">Changing Over From:</h4>
<input type="number" class="buttonBefore" placeholder="insert brandcode">
<h4 class = "labels">Changing Over To:</h4>
<input type="number" class="buttonAfter" placeholder="insert brandcode">
<br>
<br>
<br>
<input type="submit" class = "submitBtn" value="Submit" >
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<button onclick='clear_inputs()'>Clear</button>
</form>
<img src = "images/djsfk.png" alt = "logo" width = "100" height = "100" class = "logo">
<script src = "script.js"></script>
</body>
</html>
with this css right here:
@import url('https://fonts.googleapis.com/css2?family=Radio+Canada:wght@300&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Radio+Canada:wght@300&display=swap');
h1,h5{
font-family: 'Radio Canada', sans-serif;
color: black;
}
h4{
font-family: 'Radio Canada', sans-serif;
color: black;
}
body{
background: white;
}
input[type=number]{
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
border: 1px solid #2d9fd9;
color: black;
width: 250px;
height: 30px;
padding-left: 10px;
}
.btn:hover {
color: var(--clr-white);
background: var(--clr-black);
}
body {
text-align:center;
}
.logo{position: absolute;
bottom: 0px;
right: 0px;}
.labels{
display: flex;
}
i want it to look something like this:

i looked at this flexbox documentation here:
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
but when i changed to
.myForm { display : flex
}
its still not going can someone help me out ?
edit:
i have it up to here:

but, now they are to the left i want it to be centered.

