A
A
AnykeyAkaFreeman2016-04-25 11:36:50
HTML
AnykeyAkaFreeman, 2016-04-25 11:36:50

Why is the image not showing in the img tag?

In general, the problem is this:
There is such a code:

<a href="" data-toggle="modal" data-target="#myModal"><img src="images/small/2016042513164195.jpg" ></img> <br></a>				
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-belledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>  
      </div>
      <div class="modal-body"> <img src= "images/big/2016042513164147.jpg"></img>
    </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Закрыть</button>
      </div>
    </div>
  </div>
</div>

The modal window is taken from the Bootstrap example , the content of the img tags is passed from a variable, the paths are all live, the images are there, BUT the image does not appear in the modal window. What is my jamb?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
A person from Kazakhstan, 2016-04-25
@LenovoId

and you try to insert an image from google - but in the modal class = "image1" and for the link class = "image" and styles - well, if it works, then you have the wrong path to the image

A
AnykeyAkaFreeman, 2016-04-25
@AnykeyAkaFreeman

I already messed up something that I threw. That's all for sure now:
This is the source:

echo '<a href="" data-toggle="modal" data-target="#myModal"><img src="' .$row['small']. '" ></img></a>';?>
        
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>  
      </div>
      <div class="modal-body"> <img src="<? echo $row['big']; ?>"></img></div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal" align="center">Закрыть</button>
      </div>
    </div>
  </div>
</div>

And I see this in viewing the code of the generated page:
<a href="" data-toggle="modal" data-target="#myModal"><img src="images/small/2016042513164195.jpg" ></img></a>				
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>  
      </div>
      <div class="modal-body"> <img src="images/big/2016042513164147.jpg"></img></div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal" align="center">Закрыть</button>
      </div>
    </div>
  </div>
</div>

Despite the fact that if you poke at the links directly in the view-source, everything works!

A
Alexander Alekseev, 2016-04-25
@shure348

<img src="" ></img> - невалидно
<img src="" /> - правильно

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question