Website Project for school


I’m making a website with HTML and CSS for school project, but I’m having an issue. I tried to put the navigation bar to the center, but it doesn’t work. How do I put the navigation bar to the center? On the browser this is how it looks like. Can anyone help me please? Thank you!

<!DOCTYPE html>



    <title>Red Devil</title>

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link href="styles/design.css" type = "text/css" rel="stylesheet">



<nav class="selection">

  <a href="#">Menu</a>

  <a href="#">Delivery App</a>

  <a href="#">Our location</a>

  <a href="#">Contact Us</a>


<div class ="title">

  <h1 id = "Red">Red Devil</h1>


<div class ="description">

  <p id="Description">

    The Red Devil is a restaurant that delivers meals by electronic vehicles and drones!

    You can pick any meal you want and we will cook it and deliver it fast as possible!

    We are only using electronic vehicles in order to protect the environment!

    The vehicles are auto-driving mode so you don't need any interactions with a person or a drone will drop your meal right in front of your door!

    We are only available for delivery due to the Covid-19.



<div class = "row1">

  <div class="col-1-1">



  <div class="col-1-2">





* {

    box-sizing: border-box;


body {

    margin: 0;

    background-image: url("../styles/images/red.jpg");

    height: 1500px;

    width: 1500px;



.selection {

  overflow: hidden;

  background-image: url("../styles/images/hanji.jpg");

  display: inline-flexbox;



  /* Navbar links */

.selection a {

    float: right;

    display: block;

    color:  black;

    text-align: justify;

    border: 20px 40px;

    padding: 14px 20px;

    margin: 20px 80px;

    text-decoration: none;

    overflow: hidden;

    font-size: 35px;



  /* Links - change color on hover */

.selection a:hover {

    background-color: greenyellow;

    color:  black;


 #Red {


    color: #FF3D14;

    font-family: 'Kalam', cursive;

    font-size: 200px;


    position: relative;

    left: 400px;

    bottom: 100px;

    background-color: #333333;







    text-align: center;

    padding: 10px;




 #Description {





  height: 240px;









  font-family: 'Permanent Marker', cursive;

  padding: 10px;

  position: relative;

  bottom: 320px;

  left: 450px;

  text-align: center;


.col-1-1 {

     background-image: url("../styles/images/bbq치킨.jpg");

     height: 400px;

     width: 480px;   

     position: relative;

     top: 40px;


Here’s a screenshot:

1 Like

Hello! Could you please review this post on how to correctly format code in the forums.

1 Like

I’ve edited the OP’s post to correctly format the code.

@bitsurfer25092 you can look at your post to see what changes I made, or check out the link @codeneutrino posted which explains how it works. :slight_smile:

1 Like

I am pretty sure what you need to do here is to add a width to the selection element so that it takes up the width of your screen, and then justify the content center:

.selection {

    overflow: hidden;

    background-image: url("../styles/images/hanji.jpg");


    width: 100vw;

    display: inline-flex;

    justify-content: center;


It worked! Thank you very much!

1 Like

Thank you very much for telling me!

Thank you so much for telling me!