5 Replies - 241 Views - Last Post: 03 May 2020 - 12:29 PM

#1 HappyNewb   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 28-April 20

where should images be sized/resized

Posted 01 May 2020 - 06:34 PM

Hi all,

where should images be sized/resized? Html or css?

came across this recent article:

https://www.smashing...important-again

is it splitting hairs?
Is This A Good Question/Topic? 0
  • +

Replies To: where should images be sized/resized

#2 andrewsw   User is online

  • palpable absurdity
  • member icon

Reputation: 6901
  • View blog
  • Posts: 28,559
  • Joined: 12-December 12

Re: where should images be sized/resized

Posted 01 May 2020 - 11:58 PM

That is not a clear question and the link does not help.

What is the use case? What are your concerns about resizing images? Who are your audience?

Please clarify your question.
Was This Post Helpful? 0
  • +
  • -

#3 HappyNewb   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 28-April 20

Re: where should images be sized/resized

Posted 02 May 2020 - 06:18 AM

im asking if images should be resized using html or css?
in general, for web sites or web applications using images. A tutorial i was watching was saying that you wouldbt really adjust sizes of images using width height in html, you would do it in css rather, but then i came across this post from a few weeks ago saying it should be done in html...wasnt sure...
Was This Post Helpful? 0
  • +
  • -

#4 ge∅   User is offline

  • D.I.C Lover

Reputation: 318
  • View blog
  • Posts: 1,335
  • Joined: 21-November 13

Re: where should images be sized/resized

Posted 02 May 2020 - 07:09 AM

This video from Mozilla will explain in detail https://www.youtube....h?v=4-d_SoCHeWE

Long story short: if you want flexibility (most use cases will require it), do it in CSS, but if you don't want to have the page reflow during page load, specify the original dimensions in the HTML.

Also note that you can use vh or vw and calc() to make your own aspect ratios in CSS without having to rely on this optimisation. I don't remember if this technique has limitations but I remember using it with success in a project. By combining this technique with media queries you can also handle the problem expressed at the end of the video with multi-source images of different aspect ratios. It's just a lot more verbose.
Was This Post Helpful? 0
  • +
  • -

#5 danchy22   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 29
  • Joined: 27-April 20

Re: where should images be sized/resized

Posted 02 May 2020 - 08:05 AM

I feel Images should be re-sized in the css, If i have multiple images and hey all need to seperate sizes to make things easier i tend to just do it in the html.
Was This Post Helpful? 0
  • +
  • -

#6 HappyNewb   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 28-April 20

Re: where should images be sized/resized

Posted 03 May 2020 - 12:29 PM

Thanks guys
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1