Skip to main content
Participant
October 1, 2022
Question

img pointer to image not automatically adding width and height

  • October 1, 2022
  • 2 replies
  • 153 views

Dreamweaver 21.3 installed, not sure if this is a new feature or a bug.  If its a new feature, please put the option in preferences for the end user to choose whether they want this new feature or not.  Please stop breaking Dreamweaver every few months.

 

when using the pointing tool to link to an img file, it used to be that the height and width were automatically grabbed by DW to get those dimensions and add the attributes "height" and "width" for the amount of pixels.  Now when I use the pointer tool, i have to take an extra step to click on the "do not enter" icon (circle with half an x going thru it) to get DW to populate that info.  I shouldnt have to do two steps to get this info into my line of code, when for years, one step got it done.  If this is a new feature for whatever reason, put the option for the end user to use Legacy or the newer way to do it in Edit, Preferences!

This topic has been closed for replies.

2 replies

Nancy OShea
Community Expert
Community Expert
October 1, 2022
Nancy O'Shea— Product User & Community Expert
Nancy OShea
Community Expert
Community Expert
October 1, 2022

Nor should it.  How long is a piece of string?  It varies.  It's the same with images.

 

Image height & width is determined by:

  • Native image size,
  • User's viewport width,
  • Parent container in which the image resides.

 

To reduce bandwidth consumption by mobile devices, optimize images in Photoshop and export to 1x, 2x, 3x sizes.  Use the <picture> tag with SRCSET attributes to serve appropriate sized images to various devices.

 

Example:

<picture>
  <source media="(min-width:650px)" srcset="largest_image.jpg">
  <source media="(min-width:465px)" srcset="medium_image.jpg">
  <img src="mobile_image.jpg" alt="default" style="width:auto;">
</picture> 

 

Or if you're not that ambitious yet,  use the following style rule in your CSS code.

 

img {max-width:100%}

Browsers will rescale the image to fit whichever device the user has but not more than the image's native file size.  The only downside to this is that mobile devices consume more bandwidth than they should.

 

Hope that helps.

 

[Moderator moved from BUGS to DISCUSSIONS.]

 

 

Nancy O'Shea— Product User & Community Expert