Skip to main content
Known Participant
January 3, 2017
Answered

(Overly) Responsive Image Question

  • January 3, 2017
  • 3 replies
  • 2046 views

Can anyone explain why my banner image gets so small when reduced to phone size? 

Marco AVID

Also, why do the margins around my images not appear when reduced to phone-sized?

Thank you for your time and help!

Kevin

<!doctype html>

<html>

<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>Marco AVID</title>

<link href="Index css/multiColumnTemplate.css" rel="stylesheet" type="text/css">

<link href="Index css/bootstrap.css" rel="stylesheet" type="text/css">

<script src="Index css//js/jquery-1.11.3.min.js"></script>

<script src="Index css//js/bootstrap.js"></script>

<style type="text/css">

a:link {

  color: #000000;

  text-decoration: none;

}

a:visited {

  text-decoration: none;

  color: rgba(0,0,0,1);

}

a:hover {

  text-decoration: none;

  color: #888585;

}

a:active {

  color: #000000;

}

</style>

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->

<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->

<!--[if lt IE 9]>

      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>

      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>

    <![endif]-->

</head>

<body bgcolor="#FFFFFF" style="padding-top: 70px">

<div class="container">

  <header>

    <div class="row">

      <div class="col-lg-12"><img src="images/Sequence-01.gif" alt="" width="1100" height="158" class="img-responsive"/></div>

    </div>

    <div class="primary_header">

      <nav class="navbar navbar-default navbar-fixed-top">

        <div class="container-fluid">

          <!-- Brand and toggle get grouped for better mobile display -->

          <div class="navbar-header">

            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#topFixedNavbar1" aria-expanded="false"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>

          </div>

          <!-- Collect the nav links, forms, and other content for toggling -->

          <div class="collapse navbar-collapse" id="topFixedNavbar1">

            <ul class="nav navbar-nav">

              <li class="active"></li>

              <li class="active"></li>

              <li><a href="http://marcoavid.com/" title="HOME" target="_blank">HOME</a></li>

              <li><a href="https://mfms.schoolloop.com/portal/login?d=x&return_url=1414597056174" title="Schoolloop" target="_blank">Schoolloop</a></li>

              <li><a href="https://portal.capousd.org/ParentPortal/LoginParent.aspx?page=default.aspx" title="Portal" target="_blank">Student & Parent Portal</a></li>

              <li><a href="Events.htm" title="Events" target="_blank">Scheduled Events</a></li>

              <li class="dropdown"><a href="#" title="Photos & Video" class="dropdown-toggle" aria-expanded="false" aria-haspopup="true" role="button" data-toggle="dropdown">Photos & Video<span class="caret"></span></a>

                <ul class="dropdown-menu">

                  <li><a href="2016-2019_album.html">Class of 2016-2019</a></li>

                  <li><a href="2015-2018_album.html">Class of 2015-2018</a></li>

                  <li><a href="2014-2017_album.html">Class of 2014-2017</a></li>

                  <li><a href="2013-2016_album.htm">Class of 2013-2016</a></li>

                  <li><a href="2012-2015_album.htm">Class of 2012-2015</a></li>

                  <li><a href="2011-2014_album.htm">Class of 2011-2014</a></li>

                  <li><a href="2010-2013_album.htm">Class of 2010-2013</a></li>

                  <li><a href="2009-2012_album.htm">Class of 2009-2012</a></li>

                  <li><a href="2009-2011_album.htm">Class of 2009-2011</a></li>

                  <li><a href="2008-2010_album.htm">Class of 2008-2010</a></li>

                  <li><a href="2006-2008_album.htm">Class of 2006-2008</a></li>

                  <li><a href="2004-2006_album.htm">Class of 2004-2006</a></li>

                  <li><a href="#">Class of 2003-2005</a></li>

                  <li><a href="ALBUMS/2002_Yearbook.pdf">Class of 2000-2002</a></li>

                  <li><a href="ALBUMS/1999_AVID.pdf">Class of 1997-1999</a></li>

                </ul>

              </li>

              <li class="dropdown"><a href="#" title="Advice for Parents" class="dropdown-toggle" aria-expanded="false" aria-haspopup="true" role="button" data-toggle="dropdown">Advice for AVID Parents<span class="caret"></span></a>

                <ul class="dropdown-menu">

                  <li><a href="AVID_Parents.htm" title="Advice for Parents" target="_blank">English</a></li>

                  <li><a href="AVID_Parents_Spanish.html" target="_blank">Espanol</a></li>

                </ul>

              </li>

            </ul>

            <ul class="nav navbar-nav navbar-right">

              <li><a href="AVID Application.pdf" title="Application" target="_blank">AVID Application</a></li>

              <li class="dropdown"><a href="#" title="About Marco AVID" class="dropdown-toggle" aria-expanded="false" aria-haspopup="true" role="button" data-toggle="dropdown">About Marco AVID<span class="caret"></span></a>

                <ul class="dropdown-menu">

                  <li><a href="AVID_History.htm">AVID History</a></li>

                  <li><a href="Marco_AVID_History.htm">Marco AVID History</a></li>

                  <li><a href="avid_statistics.htm">AVID Statistics</a></li>

                  <li><a href="faq.htm">Frequently Asked Questions</a></li>

                  <li role="separator" class="divider"></li>

                  <li><a href="Recruitment.mp4" target="_blank">Informational Video</a></li>

                  <li><a href="Recruitment_in_Spanish.mp4" target="_blank">Video Informativo de AVID</a></li>

                </ul>

              </li>

            </ul>

          </div>

          <!-- /.navbar-collapse -->

        </div>

        <!-- /.container-fluid -->

      </nav>

    </div>

    <br>

  </header>

  <center>

  <div class="btn-group" role="group" aria-label="...">

   <a href="https://mfms.schoolloop.com/portal/login?d=x&return_url=1414597056174" target="new">   </a>

   <a href="https://portal.capousd.org/ParentPortal/LoginParent.aspx?page=default.aspx" target="new">

 

   </a>

   <a href="AVID Application.pdf" target="_blank">

 

   </a>

   <a href="AVID_Parents.htm" target="_blank">

 

   <div class="btn-group">

   

   </div>

 

   </a>

   <a href="6th_grade_resources.htm" title="6th Grade Resources" target="_blank">

   <button type="button" class="btn btn-default">6th Grade Resources </button>

   </a>

   <a href="7th_grade_resources.htm" title="7th Grade Resources" target="_blank">

   <button type="button" class="btn btn-default">7th Grade Resources </button>

   </a>

 

   <a href="8th_grade_resources.htm" title="8th Grade Resources" target="_blank">

   <button type="button" class="btn btn-default">8th Grade Resources </button>

   </a>

  <div class="dropdown-menu col-lg-1">

    <p><a class="dropdown-item" href="2016-2019_album.html">Class of 2016-2019</a><p>

   <p> <a class="dropdown-item" href="2015-2018_album.html">Class of 2015-2018</a><p>

   <p> <a href="2014-2017_album.html" target="_blank" class="dropdown-item">Class of 2014-2017</a><p>

   <p> <a href="2013-2016_album.htm" target="_blank" class="dropdown-item">Class of 2013-2016</a><p>

    <p><a href="2012-2015_album.htm" target="_blank" class="dropdown-item">Class of 2012-2015</a><p>  

    <p><a href="2011-2014_album.htm" target="_blank" class="dropdown-item">Class of 2011-2014</a><p>

    <p><a href="2010-2013_album.htm" target="_blank" class="dropdown-item">Class of 2010-2013</a><p>

    <p><a href="2009-2012_album.htm" target="_blank" class="dropdown-item">Class of 2009-2012</a><p>

    <p><a href="2009-2011_album.htm" target="_blank" class="dropdown-item">Class of 2009-2011</a><p>

    <p><a href="2008-2010_album.htm" target="_blank" class="dropdown-item">Class of 2008-2010</a><p>

    <p><a href="2006-2008_album.htm" target="_blank" class="dropdown-item">Class of 2006-2008</a><p>

    <p><a href="2004-2006_album.htm" target="_blank" class="dropdown-item">Class of 2004-2006</a><p>

    <p><a href="ALBUMS/AVID_2003-2005/2003-2005_AVID.mp4" target="_blank" class="dropdown-item">Class of 2003-2005</a><p>

    <p><a href="ALBUMS/2002_Yearbook.pdf" target="_blank" class="dropdown-item">Class of 2000-2002</a><p>

    <p><a href="ALBUMS/1999_AVID.pdf" target="_blank" class="dropdown-item">Class of 1997-1999</a><p>

          

</div>

  <h1><a href="http://www.gofundme.com/marcoavid" title="Go Fund Me" target="_blank">SUPPORT MARCO AVID THROUGH GOFUNDME.COM</a></h1>

  <hr>

  <div class="row">

    <div class="col-lg-6">

      <h3>Upcoming Events</h3>

<p>No School:  December 22, 2016 - January 8, 2017</p>

           <p>La Brea/Pink's/Hollywood/Griffith Observatory:  January 14, 2017 (7th Grade)</p>

<p>No School:  Janury 16, 2017</p>

<a href="http://marcoavid.com/Ralphs.pdf"><img src="images/Ralphs.jpg" width="538" height="101" alt=""/></a> </div>

    <div class="col-lg-6">

     <center> <video width="500" height="300" poster="images/Information Video.jpg" controls >

        <source src="Recruitment.mp4" type="video/mp4">

  </video></center>

    </div>

    <div class="col-lg-6"><a href="ALBUMS/AVID_2015-2018/2016_Bowling7/index.html" target="_blank"><img src="ALBUMS/AVID_2015-2018/2016_Bowling7/Pic.jpg" alt="" width="500" height="340" class="indeximage" title="Bowling"/></a> </div>

    <div class="col-lg-6"><a href="ALBUMS/AVID_2015-2018/2016_Knotts/index.html" target="Knotts Berry Farm 2016"><img src="ALBUMS/AVID_2015-2018/2016_Knotts/Pic - Copy.jpg" alt="" width="500" height="399" class="indeximage"/></a> </div>

    <div class="col-lg-6"><a href="ALBUMS/AVID_2014-2017/2016_Death_Valley/index.html"><img src="ALBUMS/AVID_2014-2017/2016_Death_Valley/Pic.jpg" alt="" width="500" height="333" class="indeximage"/></a> </div>

    <div class="col-lg-6"><a href="ALBUMS/AVID_2016-2019/2016_Zoo/index.html" target="new"><img src="ALBUMS/AVID_2016-2019/2016_Zoo/Pic.jpg" alt="" width="500" height="333" class="indeximage" title="Zoo"/></a></div>

    <div class="col-lg-6"><a href="ALBUMS/AVID_2015-2018/2016_SDSU/index.html" target="_blank"><img src="ALBUMS/AVID_2015-2018/2016_SDSU/Pic.jpg" alt="" width="500" height="444" class="indeximage"/></a></div>

    <div class="col-lg-1"></div>

    <div class="col-lg-1"></div>

    <div class="col-lg-1"></div>

    <div class="col-lg-1"></div>

  </div>

  <div class="row">

    <div class="col-lg-6"> </div>

    <div class="col-lg-6"> </div>

  </div>

  <section>

      <h2 class="noDisplay">Main Content</h2>

          <article class="left_article">

           <a href="ALBUMS/AVID_2014-2017/2016_Death_Valley/index.html" target="new"></a>

            <br>

            <br>

          <a href="ALBUMS/AVID_2015-2018/2016_Museum_Pier/index.html" target="_blank"> <br>

          <br>

</article>

          <a href="ALBUMS/AVID_2014-2017/2016_UCI/index.html"></a>

          <aside class="right_article"><a href="ALBUMS/AVID_2015-2018/2016_SDSU/index.html"> <br>

          </a> <a href="Ralphs.pdf"><br>

</a>

          <br>

       

      </aside>

    </section>

        <div class="row">

          <section> </section>

          <hr>

          <div class="col-md-3">

            <p><a href="HOF.htm" target="_blank" class="PageLinks">Marco AVID Hall of Fame</a></p>

          </div>

          <div class="col-md-3">

            <p><a href="AVID_AllStars.htm" target="_blank" class="PageLinks">Marco AVID All Stars</a></p>

          </div>

          <div class="col-md-3">

            <p><a href="College_Acceptance_Graphs/College_Acceptance_Graphs_index.html" target="_blank" class="PageLinks">College Acceptance Graphs</a></p>

          </div>

          <div class="col-md-3">

            <p><a href="High_School_Checklist.pdf" target="_blank" class="PageLinks">High School Checklist</a></p>

          </div>

    </div>

        <hr>

        <br>

    <div class="row">

          <div class="col-md-3"><a class="twitter-timeline" href="https://twitter.com/Marco_AVID" height="400">Tweets by Marco_AVID</a>

            <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script></div>

          <div class="col-md-3"> <p class="thumbnail_align"> <a href="Death_Valley/Death_Valley.html"><center>

            <a href="Death_Valley.html"><a href="Death_Valley/Death_Valley.html"><img src="images/death-valley-national-park.jpg" alt="" height="100%" class="img-responsive img-rounded trips" title="Death Valley Trip"/></a></a></a></p>

        

              <h4>DEATH VALLEY TRIP</h4>

              <p>November 18-22, 2017</p>

              <p> 8th Grade</p>

          </div>

          <div class="col-md-3"> <p class="thumbnail_align"> <img src="images/golden-gate-bridge.jpg" alt="" height="100%"  class="img-responsive img-rounded trips" title="Summer Trip"/></p>

          

              <h4>SUMMER TRIP</h4>

              <p>June 4-7, 2017</p>

              <p>8th Grade </p>

          </div>

          <div class="col-md-3">

            <p class="thumbnail_align"> <a href="Yosemite/Yosemite.html"><img src="images/Yosemite.jpg" alt="" height="100%" class="img-responsive img-rounded trips" title="Yosemite Trip"/></a></p>

            <h4>YOSEMITE TRIP</h4>

            <p>April 3-6, 2017</p>

            <p>7th & 8th Grade </p>

          </div>

          <div class="row">

            <div class="col-lg-6">

              <video width="90%" poster="images/Information Video.jpg" controls >

                <source src="Recruitment.mp4">

              </video>

            </div>

            <div class="col-lg-6">

              <video width="90%" poster="images/Informacion de AVID.jpg" controls >

                <source src="Recruitment_in_Spanish.mp4">

              </video>

            </div>

          </div>

          <br>

                  <br>

                        <br>

                       

           

    </div>

</center>

  </div>

</div>

</body>

<div class="row">

  <div class="col-lg-4">

<center><p><a href="https://www.instagram.com/marcoavid/"><img src="images/Instagram.jpg" width="47" height="47" alt="description"/></a>  Follow MarcoAVID on Instagram</p></center>

  </div>

  <div class="col-lg-4">

  <center><p><a href="https://www.facebook.com/profile.php?id=100013003500254"><img src="images/Facebook.png" width="47" height="47" alt="description"/></a>  Follow MarcoAVID on Facebook</p></center>

  </div>

  <div class="col-lg-4">

  <center><p><a href="https://twitter.com/Marco_AVID"><img src="images/Twitter.jpg" width="47" height="47" alt="description"/></a>  Follow MarcoAVID on Twitter</p></center>

  </div>

</div>

</html>

This topic has been closed for replies.
Correct answer osgood_

That's the way responsive images act. Unfortunately the format between a desktop and a smartphone is so radical it pretty much renders your images as useless on the smaller device - so you have to take that into consideration.

You need to rework your image into different formats - desktop, tablet and smartphone (you may get away with tablet)

Then you can use jQuery to swap the image as specific window sizes, example code below: (you obviously need to replace the links to the image with those of your own)

<!--- CODE EXAMPLE USING JQUERY -->

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8" />

<title>Swap Images</title>

<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>

<script>

$(document).ready(function(){

window.onresize = function() {

if ($(window).width() > 768) {

$('.logo').html('<img src="oxford.jpg" alt="Oxford" />');

}

if ($(window).width() < 768) {

$('.logo').html('<img src="chocolate.jpg" alt="Chocolate" />');

}

if ($(window).width() < 481) {

$('.logo').html('<img src="chester.jpg" alt="Chester" />');

}

}

});

</script>

</head>

<body>

<figure class="logo">

<img src="oxford.jpg" alt="Oxford" />

<figure>

</body>

</html>

<!--- END CODE EXAMPLE -->

This is why a lot of developers use background images - as background images can be 're-sized' as can the container they are in if you use media queries. However that wont generally help if your image contains a lot of text - in that case it needs to be refornated to more suit the format it is going to be rendered on.

3 replies

Nancy OShea
Community Expert
Community Expert
January 3, 2017

Simple answer, use a bigger banner image, remove height & width attributes, clean up your layout code.

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>Bootstrap 3.3.7 Starter</title>

<meta name="viewport" content="width=device-width, initial-scale=1">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<!--[if lt IE 9]>

<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>

<![endif]-->

<!--Bootstrap-->

<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

<style>

body { padding-top: 55px;}

</style>

</head>

<body>

<!--begin top nav bar-->

<nav class="navbar navbar-default navbar-fixed-top" role="navigation">

<div class="container-fluid">

<div class="navbar-header"> <a class="navbar-brand" href="#">XYZ BRAND</a>

<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>

</div>

<div class="collapse navbar-collapse" id="myNavbar">

<ul class="nav navbar-nav navbar-right">

<li class="active"><a href="#">MENU 1</a></li>

<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Dropdown <span class="caret"></span></a>

<ul class="dropdown-menu">

<li><a href="#">submenu 1-1</a></li>

<li><a href="#">submenu 1-2</a></li>

<li><a href="#">submenu 1-3</a></li>

</ul>

</li>

<li><a href="#">MENU 3</a></li>

<li><a href="#">MENU 4</a> </li>

<li><a href="#">MENU 5</a> </li>

</ul>

</div>

</div>

<!--end top nav-->

</nav>

<div class="container">

<header class="row"> <img class="img-responsive" src="http://dummyimage.com/1200x400.jpg" alt="my banner"> </header>

<article class="row">

<div class="col-sm-6">

<h3>Heading 3</h3>

<p>

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rerum quae recusandae ad asperiores praesentium, laborum voluptas at vero molestias ducimus, enim in, illum voluptates autem repellat laboriosam corrupti, possimus molestiae.</p>

<h3>Heading 3</h3>

<p>

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rerum quae recusandae ad asperiores praesentium, laborum voluptas at vero molestias ducimus, enim in, illum voluptates autem repellat laboriosam corrupti, possimus molestiae.</p>

  </div>

<div class="col-sm-6">

<h3>Heading 3</h3>

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cumque numquam voluptatem ut, amet eveniet minus, maxime facere hic neque unde possimus et. Libero iste, facere id pariatur minima cupiditate totam!</p>

<h3>Heading 3</h3>

<p>

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rerum quae recusandae ad asperiores praesentium, laborum voluptas at vero molestias ducimus, enim in, illum voluptates autem repellat laboriosam corrupti, possimus molestiae.</p>

</div>

</article>

<hr>

<footer class="row text-center">

<small>© 2017 Footer text goes here...</small>

</footer>

<!--/container--></div>

<!--latest jQuery-->

<script src="https://code.jquery.com/jquery-1.12.2.min.js" integrity="sha256-lZFHibXzMHo3GGeehn1hudTAP3Sc0uKXBXAzHX1sjtk=" crossorigin="anonymous"></script>

<!--Bootstrap-->

<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

</body>

</html>

Nancy O'Shea— Product User & Community Expert
Legend
January 4, 2017

Nancy OShea wrote:

Simple answer, use a bigger banner image, remove height & width attributes, clean up your layout code.

Too simple in a lot of cases. You might only want the height of the image on desktop to be quite a narrow depth.

The only way really if you are looking to maintain some kind of 'proportion' on different devices is to serve out 3 differently formated images. Its a pain, yes, sometimes you can 'cheat' by making the desktop image deeper if the circumstances are right. Only the developer can make that decision.

As there is 'image text' involved in this banner its more complex.

osgood_Correct answer
Legend
January 3, 2017

That's the way responsive images act. Unfortunately the format between a desktop and a smartphone is so radical it pretty much renders your images as useless on the smaller device - so you have to take that into consideration.

You need to rework your image into different formats - desktop, tablet and smartphone (you may get away with tablet)

Then you can use jQuery to swap the image as specific window sizes, example code below: (you obviously need to replace the links to the image with those of your own)

<!--- CODE EXAMPLE USING JQUERY -->

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8" />

<title>Swap Images</title>

<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>

<script>

$(document).ready(function(){

window.onresize = function() {

if ($(window).width() > 768) {

$('.logo').html('<img src="oxford.jpg" alt="Oxford" />');

}

if ($(window).width() < 768) {

$('.logo').html('<img src="chocolate.jpg" alt="Chocolate" />');

}

if ($(window).width() < 481) {

$('.logo').html('<img src="chester.jpg" alt="Chester" />');

}

}

});

</script>

</head>

<body>

<figure class="logo">

<img src="oxford.jpg" alt="Oxford" />

<figure>

</body>

</html>

<!--- END CODE EXAMPLE -->

This is why a lot of developers use background images - as background images can be 're-sized' as can the container they are in if you use media queries. However that wont generally help if your image contains a lot of text - in that case it needs to be refornated to more suit the format it is going to be rendered on.

KevinTGAuthor
Known Participant
January 3, 2017

I apologize for being a novice website builder.  It seems to me that the image inside some type of container should somehow change with the size of the container.

I kind of get what you are saying.  But where in the this page's HTML would that go?

Would it simply replace this?

    <div class="row">

      <div class="col-lg-12"><img src="images/Sequence-01.gif" alt="" width="1100" height="158"/></div>

   </div>

Thank you!

BenPleysier
Community Expert
Community Expert
January 5, 2017

BenPleysier wrote:

Although images have their own intrinsic height and width attributes, I tend to include these attributes for the img element so that the browser does not have to extract and compute them. This will help the browser to save the space for the image while rendering the page resulting in saved time. In this regard, it is important to note that a unit is not required as you have correctly shown in the above

<img src="ALBUMS/AVID_2015-2018/2016_Bowling7/Pic.jpg" alt="" width="500" height="340" class="img-responsive" title="Bowling"/>

It may also be worthwhile pointing out that in the online example, the jQuery library has been called twice, on lines 10 and 12 respectively. Because Bootstrap requires a minimum of version 1.11.3 and must be called before bootstrap.js, it may be wise to delete line 12.

No website developer that I follow uses a width and height attribute where the image needs to be responsive. Different strokes for different folks I guess, to me it just clogs up the html by declaring essentaily redundant tags. There might be a small arguement for reserving space on a slow connection if you want to preserve the layout while the page is downloading but unless you're living in a third world country or out in the sticks internet connectoons are pretty fast these days to alleviate such requirements.

I personally don't see any noticably difference in the test but then again I am on a lightening fast connection. Maybe if there where more images you might see a small lag in the rendering - its probably up to the developer to decide if its enough to warrant including the width and height attribute plus class in you are using Bootstrap, or not.


Fact 1: A repaint occurs when changes are made to an elements skin that changes visibility, but do not affect its layout.

Fact 2: A reflow involves changes that affect the layout of a (portion) of a page.

Fact 3: Images are renowned to be slower to render than most other parts of a document.

In the case of an image where the dimensions are not known at the time of rendering other parts of the page, the space required for the image is not taken into account. A reflow will be triggered once the intrinsic values for the dimensions of the image have been determined. This will further trigger reflows on the image's ancestors and elements that appear after it in the DOM. Then it calls a final repaint. Reflowing is very expensive.

Note that the above is relevant only where images have not been previously cached. A reload will therefore be much faster than an intial visit to the page.

Also note that, despite the fact that images hog a large chunk of bandwidth, until recently we have been stuck with the antiquated method of one image source. That is soon to be changed with the picture and source elements combined with srcset. See Responsive Images Done Right: A Guide To <picture> And srcset – Smashing Magazine

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
BenPleysier
Community Expert
Community Expert
January 3, 2017

Because of the class that you have assigned to the image as in

<img src="images/Sequence-01.gif" alt="" width="1100" height="158" class="img-responsive"/>

See http://getbootstrap.com/css/#images for more info.

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!