click below
click below
Normal Size Small Size show me how
Intro to CSS
Question | Answer |
---|---|
Define Selector | The beginning of the ruleset used to target the element that will be styled. |
Define Declaration Block | The code in-between (and including) the curly braces ({ }) that contains the CSS declaration(s). |
Define Declaration | The group name for a property and value pair that applies a style to the selected element. |
Define Property | The first part of the declaration that signifies what visual characteristic of the element is to be modified. |
Define Value | The second part of the declaration that signifies the value of the property |
CSS can select HTML elements by..... | type, class, ID & attribute |
How can all elements be selected by a universal selector? | The * symbol |
How can an element have different states? | By using pseudo-class selector |
Classes can be reusable? | True |
ID's can be used more than once? | False |
What is the order of CSS Specificity? | IDs , Classes, type |
Code below is an example of? h1, .menu { font-family: Georgia; } | Multiple Selectors |
Code below is an example of? .main p { color: red; } | Chaining & Specificity |
Code below is an example of? .main-list li { } | Descendant Combinator |
Code below is an example of? h1.special { } | Chaining |
How can nested elements be selected? | By separating selectors with a space. |
What does font-family define? | the type face of an element |
What does font-size define? | Controls size of text |
What does font-weight define? | How thick or thin text is |
What does the text-align property define? | Places text, left , right, or centre of its parent container |
What does colour define? | Text colour |
What does background-colour define? | Colour behind the text |
What does the opacity define? | Makes an element transparent |
What does background-image define? | Set the background of an element with an image |
What does the !important element do? | Overrides any style |
What does the Box Model do? | Comprises a set of properties used to create space around and between HTML elements |
How can height and width of a content area be set? | In Pixels (px) & Percentages (%) |
Define Borders | Surround the content area and padding of an element |
Define Padding | Space between the content area and the border |
Define Margin | Amount of spacing outside of an element’s border |
What do Horizontal margins add? | Right Margin + Left Margin of the adjacent element |
Define Vertical margins collapse | The space between vertically adjacent elements is equal to the larger margin |
What does margin: 0 auto do? | horizontally centres an element inside of its parent content area, if it has a width |
What properties does the "overflow" element have & do? | display , hide , scroll & dictates how HTML will render content that overflows its parent’s content area |
What does the "visibility" element do? | Can hide or show elements |
What does the positions property allow you to do? | Specify the position of an element |
What does setting an element to relative do? | An element’s position is relative to its default position on the page. |
What does setting an element to absolute do? | An elements position is relative to its closest positioned parent element. The element will still move with the rest of the document when the page is scrolled |
What does setting an element to fixed do? | An element’s position can be pinned to any part of the web page. The element will remain in view no matter what |
What does setting an element to sticky do? | An element can stick to a defined offset position when the user scrolls its parent container. |
What does setting an element to z-index do? | Specifies how far back or how far forward an element appears on the page when it overlaps other elements |
What does the display property do? | Allows you to control how an element flows vertically and horizontally in a document |
What does the inline elements do? | Takes up as little space as possible, & cant have manually adjusted width or height |
What does the block elements do? | Takes up the width of their container & have manually adjusted height |
What does inline-block elements do? | elements can have set width and height, but they can also appear next to each other and do not take up their entire container width |
What does the float property do? | Can move elements as far left or as far right as possible on a web page. |
How can you clear an element's left or right side? | Using the clear property |
Example of Hexadecimal colours | #23F41A |
Example of RGB colours | rgb(7, 210, 50) |
Example of HSL colours | hsl(200, 20%, 50%) |
What does HSL stand for? | Hue, Saturation. & Lightness |
How can you add opacity to an RGB & HSL colour value? | by adding "a" (Alpha) |