I am very new to html, css, javascript, php, and sql, so I tried to make a simple program to replicate a store's homepage. Here's the basic idea:
I wanted all my li items to all be on one line, however this didn't work, so I looked at: how to align all my li on one line? and changed display: inline to display: inline-block and added float: left and float: right, with the same html.
Then I looked at How do I render <li> side-by-side?, and took out the display: inline-block, which still didn't work, so I took out floats and added back in display: inline-block, which didn't work either.
Lastly I saw Align two inline-blocks left and right on same line and display: flex justify-content: space-between, which still didn't work.
How do I fix this?
Final code with flex and space-between:
#header {
background-color: purple;
display: flex;
justify-content: space-between;
}
ul {
list-style-type: none;
}
#navbar {
background-color: red;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>William Shop</title>
</head>
<body>
<div id="header">
<div id="navbar">
<ul>
<li>
<a href="register.php" class="register_link">Register</a>
</li>
</ul>
<ul>
<li>
<a href="loginq.php" class="login_link">Login</a>
</li>
</ul>
</div>
</div>
</body>
</html>