Blaze Summer
Blaze Summer

Reputation: 1

My Logo wont appear on the header, what is the right file path?

//HTML

<div class="logo">
            <img src="OneDrive/sublime/logo.png" alt="hi">
        </div>
    <div class="row">
        <ul class="main-nav">
            <ul>
                <li class="active"><a href="index.html">HOME</a></li>
                <li><a href="#">ABOUT</a></li>
                <li><a href="#">CONTACT</a></li>
                <li><a href="#">STUDY</a></li>
                <li><a href="#">SERVICE</a></li>
                <li><a href="blog.html">BLOG</a></li>
            </ul>
        </ul>
    </div>

//CSS

.logo   {
width: 150px;
height: auto;
float: left;
margin: 20px;
background: url('logo.png');
          }

I put my image on OneDrive in a folder called sublime and then I put the logo in that folder. I use windows 10. For some reason, the image is cropped. I would expect the whole image to be shown and not just a portion of it. there is a thing called OneDrive and I created a folder called 'sublime' and I put the logo there as 'logo.png'.

Upvotes: 0

Views: 34

Answers (2)

Yash Munjal
Yash Munjal

Reputation: 31

remove the background:url('logo.png'); inside the css. Also try object-fit: contain; inside the css

Upvotes: 1

Sarvesh Mahajan
Sarvesh Mahajan

Reputation: 924

If you are using image tag (), then what is the purpose of using background: url('logo.png') in .logo class ?

Upvotes: 0

Related Questions