Responsive Images in HTML and CSS

  Рет қаралды 46,939

Steve Griffith - Prof3ssorSt3v3

Steve Griffith - Prof3ssorSt3v3

Күн бұрын

Пікірлер: 28
@iskendev
@iskendev 5 жыл бұрын
Hi Steve, thanks for content, really useful. By the way, what is that extension that colorizing free space in VS Code?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 5 жыл бұрын
It's called Indent Rainbow.
@hiwayshoes
@hiwayshoes 5 жыл бұрын
Thank you so much, Steve! I’ve always had so much trouble wrapping my head around how to work with images, as I’m trying to work with my own images as opposed to using stock photos. Your tutorial goes a long way in making the whole process easier to grasp. So many web design/dev tutorials seem to consider images as an afterthought and provide no depth with regard to their importance. Thanks again for your valuable info!
@zooneyl2248
@zooneyl2248 2 жыл бұрын
Thank you. Why not write those html media queries in css, though? Using the background-image property and loading a different image in the url( ) as needed.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 2 жыл бұрын
That is an option too. You can write all the media queries instead if you want.
@BSUP-r7i
@BSUP-r7i 3 жыл бұрын
help me a lot, although video released for more than 2 years. Thank you.
@amitgogna2701
@amitgogna2701 4 жыл бұрын
Awesome voice..just like a professional news anchor or an orator..
@ashleydortch2445
@ashleydortch2445 5 ай бұрын
Let's us skip the ads
@jetspray3
@jetspray3 Жыл бұрын
The location where the image is saved, did you rename the images to different dimension?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 Жыл бұрын
Yes. I named them with their sizes as part of the name to make them easier to work with.
@1polyron1
@1polyron1 5 жыл бұрын
You are a HTML and CSS God!
@1polyron1
@1polyron1 5 жыл бұрын
mediaqueryception
@MrsAlewine
@MrsAlewine 2 жыл бұрын
This is so clearly explained. Thank you!
@noryanor158
@noryanor158 5 жыл бұрын
Thank you sir. Maybe next you can making tutorial about responsive canvas.
@rorygrignard9742
@rorygrignard9742 2 жыл бұрын
@HossamKhalaf-sr1oo
@HossamKhalaf-sr1oo 5 жыл бұрын
Great stuff here, guys! , thanks from Egypt.
@haythamkenway1561
@haythamkenway1561 4 жыл бұрын
what's that violet safari on your deck?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
The developer edition.
@michaeljanik1489
@michaeljanik1489 3 жыл бұрын
Thank you Steve. How can I structure the code when I want to have webp and jpg images in different sizes depending on the viewport?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
Each of the source elements inside the picture element lets you add a different image and use the media attribute to define the viewport where you want to use that image.
@michaeljanik1489
@michaeljanik1489 3 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 This didn't work in Chrome (it worked in Firefox though):
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
@@michaeljanik1489 If you are going to put multiple values inside the srcset attribute then you should be using the sizes attribute. Without the size attribute you can run into issues. I prefer to use the media attribute with a single image in each of the source elements.
@michaeljanik1489
@michaeljanik1489 3 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Thank you :-) I hope I don't demand too much: Could you give me a sample code, how I could realize that (multiple images with different sizes and the webp/Jpg).
@sigmiami
@sigmiami 3 жыл бұрын
not how you do it, cropping it - isn't really responsive.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
Responsive design means that a webpage's layout or the elements inside a page adjust or change in some way, in RESPONSE to browser conditions such as width, height, aspect ratio, pixel density etc. Having different versions of images that render based on browser conditions is absolutely responsive. If all you do is stretch or squash an image based on the screen width then you are offering a degraded non-customized non-optimized experience for your users.
@sigmiami
@sigmiami 3 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 distorting the image isn't a responsive image nor is losing the aspect ratio.. I would suggest w3 schools and css tricks have great articles on this
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
background-size: cover; Does not distort images it maintains their aspect-ratio. Cropping and creating different versions of images does not distort images or ruin their aspect-ratio either. I highly recommend CSS tricks to my students regularly, but not w3 schools. Far too often w3 schools leaves out important information or has had erroneous information.
@sigmiami
@sigmiami 3 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 we'll have to disagree - anything cropped or that loses it aspect ratio isn't really responsive - better than cropping would be to have a media query for each screen size which at least a better work around than cropping.
5 simple tips to making responsive layouts the easy way
15:54
Kevin Powell
Рет қаралды 768 М.
когда не обедаешь в школе // EVA mash
00:57
EVA mash
Рет қаралды 3,4 МЛН
🍉😋 #shorts
00:24
Денис Кукояка
Рет қаралды 3,4 МЛН
srcset and sizes attributes - [ images on the web | part one ]
30:08
Learn CSS Flexbox in 20 Minutes (Course)
20:37
Coding2GO
Рет қаралды 131 М.
Important differences between textContent and innerText
11:44
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 2,4 М.
These CSS PRO Tips & Tricks Will Blow Your Mind!
8:48
Coding2GO
Рет қаралды 342 М.
Revealing the Differences between HTML Dialogs and the Popover API
24:14
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 9 М.
A CSS Unit Deep Dive - Learn CSS Units & When To Use Them
15:13
Slaying The Dragon
Рет қаралды 89 М.
Getting Started with Webpack 5 in 2021
43:34
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 33 М.
Flexbox design patterns you can use in your projects
15:33
Kevin Powell
Рет қаралды 442 М.
Top 10 Advanced CSS Responsive Design Concepts You Should Know
20:16
Web Dev Simplified
Рет қаралды 526 М.
когда не обедаешь в школе // EVA mash
00:57
EVA mash
Рет қаралды 3,4 МЛН