- <img> <input> tags are self-closing. So that there is only one tag without a slash in front of the closing angle bracket.
- For <input>
- For <input> with type "text",you can use palceholder to fill some default values at first and use required to make sure the input must be filled before submitting.
- For <input> with type "radio" and "checkbox", you can use "checked" to make it the default value.
- For <input> with type "radio" and "checkbox", you must specify the same name for all of them. And a kindly reminder is the radio and checkbox can be nested inside of <label>
- All of the other elements will inherit syles from body element.
- The order of classes declaration in <style> section is what is important. The second one will always take precedence over the first one.
- id declaration can take precedence over class declaration. It doesn't matter where the id declaration is in <style> section.
- In line style has the higher priority than id declaration.
- The attribute !important has the highest priority in CSS.
<style> body { background-color: black; font-family: Monospace; color: green; } #orange-text { color: orange; } .pink-text { color: pink !important; } .blue-text { color: blue; } </style> <h1 id="orange-text" class="pink-text blue-text" style="color: white">Hello World!</h1>
8 There are three ways to represent color in CSS.
(1)#000000
(2)#f00 the abbreviation of the first one. This way will reduce the number of colors that it can represent.
(3)rgb(255,0,0)
9