photos in css | XM Community
Solved

photos in css

  • 11 November 2018
  • 2 replies
  • 11 views

Hello. When using css, what is the best way to add photos and to address them by css?
icon

Best answer by Anonymous 11 November 2018, 19:20

View original

2 replies

Hello @Brosen ,

Hope the following will help you:

We can add photos using `<img>` tag in HTML as follows:
`<img id="imgID" class="imgClass" src="IMAGE_URL" />`

We can refer the `<img>` tag in the css in the following ways:
1. Using Tag -> `img{ //css attributes }`
2. Using id -> ` #imgID{ //css attributes }`
3. Using class -> ` .imgClass{ //css attributes }`

Two or more `<img> `tag can have same class name but different ID name.
The best way is to assingn different ID to different `<img>` tag(if they are several) and target each of them using id, allowing you to add different css property to different `<img>` tag
Thanks!

Leave a Reply