How can I use CSS to style multiple images differently

0 votes

In essence, I'm styling a lengthy essay with a variety of photographs thrown in. The first image should "float: left," while the second image should "float: right." I am confident that I can style the pictures as follows:

img {
float: left;
}

As a result, each photograph has the same aesthetic. How may each image be styled differently? I attempted to style each image individually by placing it in a new div class, but it didn't work.

I also realise that I could design each image using the following html tag:

<img src="ABCD.png" alt="Raoul Hausmann's ABCD" align="left" height="300px">

I keep hearing that keeping style in an external style sheet (CSS) and keeping html separate is ideal. Is inline styling required in this situation?

Jun 16 in CSS by Edureka
• 7,660 points
7 views

1 answer to this question.

0 votes
You can do that in HTML (delete the references to leftPicture and rightPicture adjacent to. picture and then provide two CSS classes to the same effect.. class="image leftPicture"..
answered 5 days ago by Edureka
• 8,460 points

Related Questions In CSS

0 votes
1 answer
0 votes
1 answer

How to add border in my clip-path: polygon(); CSS style

Using an SVG Dilation Filter to Add ...READ MORE

answered 5 days ago in CSS by Edureka
• 8,460 points
7 views
0 votes
1 answer

How can I define colors as variables in CSS?

CSS does not use variables. You can, ...READ MORE

answered 5 days ago in CSS by Edureka
• 8,460 points
7 views
0 votes
1 answer
0 votes
1 answer

Render HTML to an image

To answer your question, there are a ...READ MORE

answered Feb 8 in Java by Soham
• 8,730 points
284 views
0 votes
0 answers

seo - images and h1

I like to have logos instead of ...READ MORE

Mar 9 in Digital Marketing by Kichu
• 19,040 points
28 views
0 votes
0 answers

When to use IMG vs. CSS background-image?

In what situations is it more appropriate ...READ MORE

Mar 10 in Digital Marketing by Kichu
• 19,040 points
25 views
0 votes
1 answer

CSS - Darken image except for rectangle overlay

Perhaps try constructing four boxes, one on ...READ MORE

answered May 28 in CSS by Edureka
• 8,460 points
21 views
0 votes
1 answer

How to set Bullet colors in UL/LI html lists via CSS without using any images or span tags

I use jQuery for this: jQuery('li').wrapInner('<span class="li_content" />'); & ...READ MORE

answered May 27 in CSS by Edureka
• 8,460 points
27 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP