Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Images resized by the browser

Featured Replies

This a simple one really. All the stuff I do is responsive and despite the issues involved, I don't usually have problems with images other than the occasional 'serve scaled images' to improve the speed. The little gripe I have at the moment is when I do testing on numerous platforms, I continually have recommendations to set height and width attributes within the markup. I have done this, but it doesn't have much of an effect.

 

The sites load up relatively well and the images resize accordingly, but the perfectionist in me wants to ensure everything is running smoothly and effectively (I made another post along the same lines about validation a minute ago). A bog standard HTML example would be:

 

<img src="img/some-image.png" alt="Some image" height="400" width="400"/>
 

and the CSS:

 

 

img {
    max-width: 100%;
    height: auto;
}
 

Granted each image is different and this is only a basic example. A lot of the sites I've worked on in the past don't have the height and width attributes set in the markup or css. Should I get out my hammer now? ;)

I haven't set them in html since my dreamweaver days (as it was automatic). I never really thought about it since it passes validation without. There are a lot of attributes that can be set but aren't obligatory. From where did you get the recommendations?

The reason it's recommended to set the dimensions (or one, at least) is because if the image isn't loadable for any reason, the layout still keeps it's spacing. This happens when you have your height set to auto in css too.

 

View here for an example.

 

In the example, the paragraph is supposed to be 200px down. Play about with it to see what takes effect.

 

Hope I understood the question :)

 

~evu.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.