Styling Image size in the picture element

Hi, I’m new but eager to learn.
So, I’ve been learning html and css until i bumped into the so called picture element. (I’ve had no problems with the img element prior. When I want to set a width and height for my image which is very large btw, it’s not working with the widht and height attribute. My image and the srcset attribute are inside the picture element so i really don’t no what to do. I also tried using sizes attribute but no use either. How do i style the size of my image in the picture element?? Thanks

Please show the code you have so far. Thanks

<div id="vv"><picture >
    <source media="(min-width: 600px)" style="width:80px" srcset="wallpaperflare.com_wallpaper (12).jpg" size="80%">
		<source media="(min-width: 465px)" srcset="wallpaperflare.com_wallpaper (12).jpg">
		<img src="wallpaperflare.com_wallpaper (16).jpg" style="width:auto" alt="galaxy">
		
		
	</picture>
		</div>

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

okay, thank you for this.

What do you think about my code?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.