Website component | HTML tag | CSS Selector |
---|---|---|
Full webpage | <body> |
body |
Heading | <h1> |
h1 |
Image | <img> |
img |
Paragraph | <p> |
p |
Full table | <table> |
table |
Every row in the table | <tr> |
tr |
Every even numbered row in the table | <tr> |
tr:nth-child(even) |
Every odd numbered row in the table | <tr> |
tr:nth-child(odd) |
Every table heading in the table | <th> |
th |
Every piece of content in the table | <td> |
td |
Every list item | <li> |
li |
What do you want to change? | CSS Property | CSS Values |
---|---|---|
Text color | color | red , green , magenta , HEX codes, rgba() etc. |
Text style | font-family | cursive , monospace , sans-serif , serif , and fantasy |
Background color | background-color | red , green , magenta , etc. |
Align text | text-align | center , left , right , and justify |
Align non-text elements (like images) | You need two properties: display and margin |
The value for display should be block and for margin should be 0 auto |
Borders around content | Any of border-left , border-right , border-top , border-bottom |
The value takes the form borderwidth bordertype bordercolor . borderwidth is a number followed by the letters px , e.g. 2px . bordertype is any of dotted , dashed , solid , double , groove , ridge , inset , or outset . bordercolor works the same way as other color CSS rules, e.g. red .For example, a border value could be: 2px solid blue |