This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:web_development:tables:selectors [2021/12/07 14:00] mag created |
en:web_development:tables:selectors [2023/08/16 09:33] (current) |
||
---|---|---|---|
Line 5: | Line 5: | ||
==== Setup ==== | ==== Setup ==== | ||
- | * As usual, we'll build on previous work in this activity using [[https:// | + | * We'll build on previous work in this activity using your ' |
- | **HTML** | + | **tables.html** |
< | < | ||
< | < | ||
Line 49: | Line 49: | ||
</ | </ | ||
- | **CSS** | + | **style.css** |
< | < | ||
border-width: | border-width: | ||
Line 69: | Line 69: | ||
* You may have noticed that using styles in HTML lets you change a single element, while using CSS lets you change all associated elements, but what if you want to change just certain elements? | * You may have noticed that using styles in HTML lets you change a single element, while using CSS lets you change all associated elements, but what if you want to change just certain elements? | ||
* To do this we use selectors, which identify the specific elements you want to treat differently. | * To do this we use selectors, which identify the specific elements you want to treat differently. | ||
- | * The first of these is < | + | * The first of these is < |
* Let's highlight the data for Carlos in yellow. | * Let's highlight the data for Carlos in yellow. | ||
* First, we need to specify the row, but giving it an < | * First, we need to specify the row, but giving it an < | ||
Line 135: | Line 135: | ||
< | < | ||
font-weight: | font-weight: | ||
- | } | + | }</ |
* We can also limit in other ways, One is to use a combination of elements and classes. | * We can also limit in other ways, One is to use a combination of elements and classes. | ||
* The following code will only change the non-heading (data) cells with the age class. | * The following code will only change the non-heading (data) cells with the age class. | ||
Line 144: | Line 144: | ||
* Notice the difference between the last two examples. The first < | * Notice the difference between the last two examples. The first < | ||
* There are many other ways of specifying and combining selectors, but these are the main ones you'll use often. For more, follow the link on the Summary page. | * There are many other ways of specifying and combining selectors, but these are the main ones you'll use often. For more, follow the link on the Summary page. | ||
+ | |||
+ | ==== Final Code ==== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
[[en: | [[en: |