Basic and Advance CSS Examples and Concepts Question:
What Is a Mixed Selector in CSS?

Answer:
A mixed selector is a selector that uses a combination of all other selectors. The following CSS shows some good examples:
/* selects <p class="quote"> tags */
P.quote {font-style: italic}
/* selects <p class="quote" id="onSale"> tags */
P.quote#onSale {color: red}
/* selects <p class=quote id=onSale> tags inside <table> */
TABLE P.quote#onSale {background-color: red}
/* selects <pre class=quote id=onSale> tags inside <table>
and <pre id="onSale"> tags */
TABLE P.quote#onSale, PRE#onSale {background-color: red}
/* selects <p class="quote"> tags */
P.quote {font-style: italic}
/* selects <p class="quote" id="onSale"> tags */
P.quote#onSale {color: red}
/* selects <p class=quote id=onSale> tags inside <table> */
TABLE P.quote#onSale {background-color: red}
/* selects <pre class=quote id=onSale> tags inside <table>
and <pre id="onSale"> tags */
TABLE P.quote#onSale, PRE#onSale {background-color: red}
Previous Question | Next Question |
What Is a Group Selector in CSS? | What Are the Pseudo Classes on <A> Tags? |