Problem when inserting HTML image

1

I'm trying to put an image in my HTML file and it's strange for me not to load my image, only a small icon appears instead of my photo and I do not know if I had never had problems inserting my images, I did everything from putting the end .jpg to change the folder file and even then I did not load the image, here I leave my code.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">

    <link rel="stylesheet" href="nuevo.css"/>
    <link rel="stylesheet"     href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
    <link href='https://fonts.googleapis.com/css?family=Libre+Baskerville' rel='stylesheet' type='text/css'>
    <title></title>
  </head>
  <body>

    <header>
      <h1>
        Foto-booth
      </h1>

    <nav role="navigation">
        <ul class="nav nav-pills">
          <li role="presentation" class="active"><a href="#">Inicio</a></li>
          <li role="presentation"><a href="#">Perfil</a></li>
          <li role="presentation"><a href="#">Mensajes</a></li>
        </ul>
      </nav>
    </header>

    <img src="02.jpg">

<p>hola</p>

  </body>
</html>

The problem is not that the image does not appear, if it appears but does not load, only a small picture appears as 1 by 1px (that small picture is not the image, it is a default image x) I do not know why it does not load

    
asked by Ricardo A 01.07.2016 в 16:37
source

2 answers

1

It does not load the image because it may not be in the root folder.

If you have it in a folder try putting this:

<img src="carpeta/02.jpg"/>

If your structure is like this the previous code would work well

-css
    -miestilo.css
-img
    -02.jpg
    -03.jpg
-index.html

If your HTML file is inside a folder the previous code will not show anything

-css
    -miestilo.css
-img
    -02.jpg
    -03.jpg
-vistas
    -index.html

therefore the HTML that you should put is:

<img src="../img/02.jpg"/>

The .. points mean to leave a folder to access img, you will have to put as many as necessary to get to the directory of the img folder

    
answered by 01.07.2016 в 16:51
0
  

Posted by the OP in the comments

The problem was that at the time of recording the changes instead of saving the changes in my own file, I created a new one with everything identical and therefore could not do either with one or the other, it's a long story.

    
answered by 13.04.2017 в 15:00