Aligning Images with CSS

csd-unit-2
#1

My students want to align their images on their style sheets…is there a way they can style just one image? They currently have more than one on their page and do not know how to signify which image they want the style rule applied to. Any help is appreciated!

#2

I think you want to look into CSS classes.
These are taught here

Let us know how it goes.

3 Likes
#3

For one image I would use an id. It’s a similar set up to a class, except you use a # in the css.

on the html page:
< img id = “demo” src=“fall.jpeg”
alt=“Bench in fall” >

on the css page:
#demo{

}

https://www.w3schools.com/css/css_syntax.asp

4 Likes
#4

This was very helpful! It worked beautifully. My students and I appreciate the help!

3 Likes