how can I put a picture in my website using css background image

Im making a website using the bootstrap template and im trying to put the logo of a mock up company to show in the header

I think the problem is with the path that points to the image but im not sure.

Here is a picture of where the image is located in my files
the order of the files image link

<!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">
    <title>David Chu's China Bistro</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/styles.css">
    <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Oxygen&family=Salsa&display=swap" rel="stylesheet">

  </head>
<body>
    <header>
        <nav id="header-nav" class="navbar navbar default">
            <div class="container">
            <div class= "navbar-header">
             <a href="index.html" class="">
                <div id=" logo-img"> <img src=""></div>
            </a>
body {
  font-size: 16px;
  color: #fff;
  background-color: #61122f;
  font-family: 'Oxygen', sans-serif;
font-family: 'Salsa', cursive;
}
#header-nav{
    background-color: #f6b319;
    border-radius:0;
    border: 0;
}
#logo-img {
    background: url('../images/resturant-logo.png') no-repeat ;
    width: 150px;
    height: 150px;
    margin: 10px 15px 10px 0;

}
.navbar-brand{
    padding: 0px;
    margin: 0;
}```

Your code is fine, just be sure to check typos in the future.
The div id contains a blankspace at the beginning, delete it and will work.

<div id="[here]logo-img"> <img src=""></div>

Leave a Comment