In CSS, if a div in html were to have multiple CSS properties (be it the color red, animated, change color) why do I need to specify in a CSS file multiple CSS selectors to do so? Why can't I combine all those CSS properties into one selector?
manofprogram 0 Newbie Poster
Recommended Answers
Jump to PostYes you can combine all of those properties using one selector. Is there a reason why you believe that you couldn't. Do you have an example?
Jump to Postul#navmenu li:hover > a { background-color: #CFC; } ul#navmenu li:hover a:hover { background-color: #FF0; }
Both of these selectors are basically targetting the same element. They are actually both applying but since there is more than of the same background-color property applied, one has to take …
All 5 Replies
JorgeM 958 Problem Solver Team Colleague Featured Poster
manofprogram 0 Newbie Poster
Nathanaelneal -3 Networks
gentlemedia commented: Don't hijack someone else' thread. Start your own thread! +0
JorgeM 958 Problem Solver Team Colleague Featured Poster
tdrosiadis 0 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.