HTML
Can i attach more than one declaration to a selector?
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Jan 3, 2012, 8:24 PM EST
Yes. You must add a semi colon if more than one declaration to a selector.
Selector {declaration1; declaration2}
P {background: white; color: red}
Thanks
Priya LingeRank #785 · 2.9K reputationPosted Jan 3, 2012, 8:58 PM EST
1.Yes, We can attach more than one declaration to a selector.
2.we can attached More than one declaration to a selector by using semi colon .
3.Example :
P {background: white; color: black}
Thanks.
Harsh ShahRank #1,322 · 1.3K reputationPosted Mar 2, 2020, 5:26 PM EST
Mageshwaran RRank #411 · 6.1K reputationPosted Nov 12, 2019, 3:38 AM EST