i am trying to copy some webpages to learn html and css.when i try to create header like image given below the righ elements which is abastract and helpcenter comes below one another.i want to align those two items horizontally.also i am unable to change font color of the same items
output i have right now;
[![
*{
padding: 0px;
margin: 0px;
}
header{
background-color: black;
height: 100px;
}
.menu{
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 20px;
color: #fff;
}
.menu ul {
list-style: none;
}
<!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>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<div >
<ul>
<li><a href="#">Abstract</a></li>
<li><a href="#">Help center</a></li>
</ul>
<div >
<button >Submit</button>
<button >Signin</button>
</div>
</div>
</header>
</body>
</html>
CodePudding user response:
I can't access the images. Is this what you're looking for?
* {
padding: 0px;
margin: 0px;
}
header {
background-color: black;
height: 100px;
}
.menu {
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 20px;
color: #fff;
}
.menu ul {
list-style: none;
display:flex;
}
.menu ul li a{
color: white;
text-decoration: none;
margin: 10px;
}
<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>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<div >
<ul>
<li><a href="#">Abstract</a></li>
<li><a href="#">Help center</a></li>
</ul>
<div >
<button >Submit</button>
<button >Signin</button>
</div>
</div>
</header>
</body>
</html>