Bonding Through Coding

Width

width is usually used for changing the size of an image. We can change the width of an image using pixel px or percentages %. Pixels are good for when you have a specific ratio in mind, whilst percentage is good for when you dont’, and its usually easier to use. Width can be determined in either HTML or CSS, and can be done in both!

Example

I can use width to specify how wide I want my image to be!

img {
    width: 50%; 
}

You can also give it the auto value, which will change the image based on the size of the page. This can be especially useful if you want your image to be a consistent size across multiple screen sizes.

If you want to know more about the width property, you can go to the links at MDN Web Docs or w3schools. Both of these sites give excellent examples of the width CSS property that are interactive, and allow you to change and alter the values to see how the property works.