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, 2022 in CSS by Edureka
• 12,890 points
538 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 Jun 21, 2022 by Edureka
• 11,450 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 Jun 21, 2022 in CSS by Edureka
• 11,450 points
2,410 views
0 votes
1 answer

How can I define colors as variables in CSS?

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

answered Jun 21, 2022 in CSS by Edureka
• 11,450 points
118 views
0 votes
1 answer

How to use CSS media query to scale background-image to viewing window

If you only want the desktop version ...READ MORE

answered Jun 17, 2022 in CSS by Edureka
• 11,450 points
372 views
0 votes
1 answer

Render HTML to an image

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

answered Feb 8, 2022 in Java by Soham
• 9,700 points
930 views
0 votes
1 answer

seo - images and h1

SEO is speculative at best. Generally, the accepted ...READ MORE

answered Mar 11, 2022 in Digital Marketing by narikkadan
• 51,240 points
215 views
0 votes
0 answers

When to use IMG vs. CSS background-image?

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

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

CSS - Darken image except for rectangle overlay

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

answered May 28, 2022 in CSS by Edureka
• 11,450 points
242 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, 2022 in CSS by Edureka
• 11,450 points
315 views
0 votes
1 answer

"SyntaxError: Invalid or unexpected token" - How to SSR images/css with react

The first thing to highlight is that ...READ MORE

answered Jun 1, 2022 in CSS by Edureka
• 11,450 points
2,001 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP