0

I have 2 HTML elements that are of the same type. One element has an ID of thing1 the other has an ID of thing2. The class attributes for both of these elements are different as well.

I want both of these HTML elements to use 1 CSS class that I have written.

Is it possible for 2 elemnts with different ID and Class attributes to call the same CSS class.

2 Answers 2

4
#thing1, #thing2 { css here }

Simply call both IDs.

or add another class...

.additional { css here }

<div id="thing1" class="something aditional"></div>

<div id="thing2" class="thingclass aditional"></div>
Sign up to request clarification or add additional context in comments.

1 Comment

Okay, I just wasn't sure if that was possible and or the syntax of it.
0

What elements?

If it's a div, style all div tags, etc.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.