1/158
Looks like no tags are added yet.
What are <div> and <span> elements used for?
Styling purposes
What are the two types of elements?
Block-level elements. Inline-level elements
What is a block level element?
Elements that begin on a new line stack on top of each other and occupy any available width e.g. <p>
What is an inline level element?
Elements that do not begin on a new line. Fall into the flow of the document line up one after another and only maintain the width of their content
What is used for html comments?
<!-- - - >
What is used for css comments?
/* */
What tag is used for paragraphs?
<p>
What two tags can you use to make text bold?
<strong> <b>
Difference between <strong> and <b>
<strong> used for text that’s important and <b> is to draw attention to text without indicating its important
What does CSS stand for?
Cascading style sheets
What is a self-closing element?
An elemeny that does not need a closing tag
What does a tyoe selector target?
Targets elements by the element type
What is a class selector and what notation does it use
Select an element based on the element’s class attribute value (.)
What is an id selector and what notation does it use
Select an element based on the element’s id attribute value (#)
How is text italicised?
<em> element
Is <em> an inline-element or block-level element?
Inline-level element
When do you use the <em> element and when do you use the <i> element?
<em> used to place stress on a text <i> used to convey text in an alternative tone
When should you use <article> <section> or <div>
<div> for if the content is grouped for only styling purposes. <article> if content adds to the document and if removed from the page and moved elsewhere it still should make sense. <section> if the content adds to the document and represents a thematic group of content
What is the <aside> element used for?
Holds content that’s a side bar or brief explanation
What is cross-browser compatibility?
When a website looks the same/similar on different browsers as different browsers render elements in different ways
What is a relative path?
Links pointing to other pages of the same website which does not include a domain (.org .com .edu)
What is an absolute path?
Where the link includes the full domain (http:// and .com .org etc)
How to code a website to open a link in a new page?
Add target=”_blank” after the href link
If two conflicting selections e.g. backgroud green or orange are in two different selectors which one remains?
The colour in the first selector as that takes precedence
If two conflicting selections e.g. backgroud green or orange are in the same selector which one remains?
The last one mentioned
Specificity weight of a type selector
0-0-1
Specificity weight of a class selector
0-1-0
Specificity weight of an id selector
1-0-0
Name the 3 selectors in descending order of specificity
Id selector. Class selector. Type selector
The higher the … weight of a selector the more … the selector is given when a styling conflict occurs
Specificity. Priority
What is a key selector?
Selector farthest from the right directly before the curly bracket
What does the key selector do?
Identifies which element the style will be applied to
What is a prequalifier?
Any selector to the left of a key selector
The … the specifity weights the … likely the cascade is to break
Higher. More
How can you keep the specificity weight of your selectors low?
Layering styles where you tie styles you want to reuse to one class and can layer on styles from another class
How do you select an rgb colour in CSS?
rgb() function
How do you select an rgb colour that you want to control the transparency of in CSS?
rgba() wherea 4th value is needed and is between 1 and 0
What does HSL stand for?
Hue Saturation Lightness
What are absolute lengths?
Simplest length values as they are fixed to a physical measurement e.g. inches e.g. pixels px
What is a pixel equal to in inches?
1/96th of an inch
What is a relative length?
Units of measurements that rely on the length of another measurement e.g. percentages
What are the common values for the display property?
Block. Inline. Inline block
What does the inline-block value do?
Allows an element to behave as a block-level element allowing it to accept all box model properties. Howerever it is displayed in line with other elements
Do inline block elements have a small space between them?
Yes
What does none do?
Hides and element and the elements nested within it
What is the box model?
Every element on a page is a rectangular box and may have width height borders and margins
How is the total width of an element calculated?
margin-right + border-right + padding-right + width + padding-left + border-left + margin-left
How is the total height of an element calculated?
margin-top + border-top + padding-top + height + padding-bottom + border-bottom + margin bottom
Do inline-level elements use the height and width properties?
No
What does the margin property do?
Allows to set the amount of space that surrounds an element. It falls outside of the border
What does the padding property do?
Allows to set the amount of space that surrounds an element. It falls inside of the border
Does the margin property work vertically on inline-level elements?
No
Does the padding property work vertically on inline-level elements?
Yes
What does the border-radius property do?
Identifies the radius by which the corners of an element are to be rounded
What does the box-sizing property do?
Allows how the box-model works to be changed and how an element’s size is calculated
What does content-box do?
Default value. Leaves box-model as an additive design
What does the padding-box value do?
Alters the box model by including padding property values within the width and height of an element
Should you use the padding-box value?
No
What is the border-box value?
Alters box model so that any border or padding property values are included within the width and height of an element.
Do margins fall under the border-box value?
No
Possible drawback of using the box-sizing property?
Isn’t supported in every browser especially older versions
How to see the Developers Tools in Google Chrome?
“View“ within the menu bar. “Developer”. “Developer’s Tools”
What does the float property do?
Allows us to take an element and remove it from the normal flow of a page to position it to the left or right of its parent element
What do floats do to an elements display value?
Will change any non-block elements into block ones which allows them to take a height and width value
What does clear:left do?
Ensures content is under any items that are already n the left making it left on a new line
What does clear:both do?
Moves the element down under any elements that are floated to either the left or the right
what does .group:before, .group:after do? (containing floats/clearfix)
Pseudo elements created before and after. They contain no content. The pseudo elements clears the floats
Why do you clearfix elements rather than just clear:both?
Prevents layout problems
How to remove spaces between inline-block element? (2)
Put a new <section> elementy opening on the same line as the previous’ <section> closing tag. Open a HTML comment directly after an inline-block closing tag close comment before next opening tag