Ive been trying to add a logo I created and saved it as a .png file but all that shows up in the left hand corner of my navbar is a small square with a question mark.
Can you share your code and folder structure?
It seems like you have entered the invalid path for your image’s src
attribute.
<img src="may be the problem lies here" >
If you can share your code, then it’ll be easier for us to see what’s wrong with your code.
Edit: Are you sure you saved the image in same directory as your source file?
<html>
<body>
<nav class="navbar navbar-toggleable-md navbar-light bg-inverse">
<a class="navbar-brand" href="#">
<img src="//images/logo.png" width="30" height="30" alt="">
</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<h1 class="navbar-brand" href="#"></h1>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Projects</a>
</li>
</ul>
</div>
</nav>
<h1 class= "text-center">Sergio's Portfolio</h1>
<p>My name is Sergio Alvarado, I am a recent Learn Academy graduate. I've been interning at Victorise for a month and have been learning Angular and Ionic. I was born and rased in North County and been living in Carlsbad, CA. </p>
</body>
</html>
I cleaned up your code.
You need to use triple backticks to post code to the forum.
See this post for details.
<html>
<body>
<nav class="navbar navbar-toggleable-md navbar-light bg-inverse">
<a class="navbar-brand" href="#">
<img src="//images/logo.png" width="30" height="30" alt="">
</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<h1 class="navbar-brand" href="#"></h1>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Projects</a>
</li>
</ul>
</div>
</nav>
<h1 class= "text-center">Sergio's Portfolio</h1>
<p>My name is Sergio Alvarado, I am a recent Learn Academy graduate. I've been interning at Victorise for a month and have been learning Angular and Ionic. I was born and rased in North County and been living in Carlsbad, CA. </p>
</body>
</html>
I added the backpacks
You can usually click the image to see the path it uses. You are currently using //
, but you probably need ‘/’:
http://www.webreference.com/html/tutorial2/3.html
file:///Users/sergioalvarado5143/Desktop/images/logo.png that is what it says when I open it in chrome
And when you open your image (not from your website but from your file explorer), what does I show?
<img src="//images/logo.png" width="30" height="30" alt="">
//images/logo.png
starts with a doubleslash which should be followed by a valid domain like example.com
or localhost
- use /images/logo.png
if the path is at the root level of the current domain
I have Mac and all it shows when I open it in preview mode is logo.png at the top center
even though it on my desktop and in the file images?
There is no “Open with …” option? A browser should show you the path
<img style="-webkit-user-select: none; display: block; margin: auto; cursor: zoom-in;" src="file:///Users/sergioalvarado5143/Desktop/images/logo.png" width="317" height="317">
there is what option should I choose
Where is index.html
relative to the images
directory? What is the full URL used to load index.html
?
I don’t know if I go into my images folder I created and open the image with google and then inspect it it gives me that code
sorry I’m on codeine.io I’m not sure why don’t have index.html
My fault - I meant the HTML file above - where is it located in the files directory tree and how are you accessing it in the browser?