CSS Foundation Flashcards
What does CSS stand for?
Cascading Style Sheet
What is CSS used for?
CSS is used to style web pages e.g. the layout, colour etc.
True or false:
CSS is used to create page layouts in websites?
True.
True or false:
There is more than one way to add CSS to a web page.
True e.g. you can add CSS via an external stylesheet or in the style element in the head of a web page.
What is a CSS ‘style block’?
It is an opening and closing CSS tag with CSS code in between, which is located in the head element.
What are the opening and closing tags for a CSS style block?
No, there is no HTML code, just CSS.
In this code, which is the ‘selector’:
In this code, which is the value:
‘blue’
In this code, which is the property:
‘color’
What would you call this chunk of code:
A CSS declaration block, as there are more than one declarations:
What does this code do:
It selects ALL h2 tags in the page(s), and sets the text color to blue.
If you don’t set the font-size in CSS, what does the web browser do?
It will use the default/automatic font-size set by the browser.
How many CSS declarations do we have in this chunk of code: {color: red; font-size: 24px;}
There are two declarations:
color: red;
font-size: 24 px;
What are the Web Developer Tools and how can you access them?
They are tools to assist web developers which are accessible via hitting F12 in Chrome.
How do you inspect the element in Google Chrome?
Via one of two ways:
- Select a section of the page, right click and select Inspect Element
- Select a section of the page and press Ctrl + Shift + i
What does this tag do?
Links the web page to an external CSS style sheet.
What would the code look like for a link tag which points to an external CSS style sheet called page.css?
What do div tags do?
Div tags create sections/divisions in the web page.
Why does it sometimes help to leave a comment next to a closing tag?
To clearly mark where the tag ends.
Why would you indent code?
To clearly show which tags are nested/sub tags to make the code easier to read.
What do you call the logical meaning of HTML tags? And what does that term mean?
The semantic meaning. A semantic element clearly describes its meaning to both the browser and the developer.
What is the SEMANTIC meaning of these tags:
What are the four ways to set the color value in CSS?
The code appears as the following:
- RGB
- HSL
- HEX
- Named colours
How can you quickly access a colour picker?
- Select Inspect Element (or CTRL+SHIFT+I)
- Select the colour box next to any code with a colour.
- Use SHIFT+click to change the colour method.
When changing code in the web developer tools, WHERE are you changing the code?
You are changing the code that is ONLY in the browser’s memory. Your changes will not be saved to the web page.
What does a CSS comment look like?
/* This is a CSS comment */
When code is in HTML or CSS comments, what does the browser do when it reads those comments?
Ignore all text in the Comments.
What’s a prototype web page?
A page built quickly as a mock up.
What CSS color type/value gives you the LEAST amount of control?
Name colours.
What color will the h1 tag be and why?
h1 {
color: red;
color: blue;
color: green;
}
Green, because the browser will use the last line of code.
What is the CSS property text-transform used for and what values can be defined?
Text-transform is used primarily for capitalization.
The following can values be defined:
text-transform: capitalize
text-transform: uppercase
text-transform: lowercase
What is the CSS property text-align used for and what values can be defined?
To align text to the center, left, right or justify
What is the CSS property text-decoration used for and what values can be defined?
Text-decoration sets the decoration of the text e.g. overline, line-through, underline
What is the CSS property text-indent used for and what values can be defined?
It indents the first line by how many pixels you set.
What term is used to mean ‘render the web page’?
For the browser to display the web page.
What is the CSS property font-weight used for and what values can be defined?
To change the font weight, make it bolder, lighter, bold or normal
What is the difference between these two selectors:
p.italic
p .italic
When setting font weight, you have the options ‘bold’ and ‘bolder’ … is there any difference displayed in the browser?
There is no visible difference in most browsers.
True or false: Not all of the official CSS rules work in the web browsers
True
What are the 3 basic font types?
Sans serif, Serif, Monospace
What are Web Safe Fonts?
Fonts that you are SURE people have on their computers.
When you declare your fonts after the font-family property, what do you need to do for the fonts which have more than one word as part of their name? For example, Times New Roman.
Ensure that the font is enclosed with quotes e.g.
{font-family:
“Times New Roman”, Arial, Verdana}
What CSS property will set the size of a text?
font-size
How would you set the font size in a body selector to 14px?
Using only ONE declaration block, how would you set both the h1 and h2 tags to have a red text color?
Using only ONE declaration block, how would you set the text color to black using the LONG FORM HEX code for both the h1 and h2 tags?
What is a pixel?
The pixel (a word invented from “picture element”) is the basic unit of programmable color on a computer display or in a computer image.
Which option below is true?
a) When you set a font size to pixels, the font size can change depending on the size of the browser window.
b) When you set font size to pixels, the font size is fixed - it does not change.
c) Both are false.
b) When you set font size to pixels, the font size is fixed - it does not change.
What is VW short for?
Viewport Width
VW = viewport width. How is this best described?
Viewport width is a relative unit of measure - it flexes.
If you set your font size to 5vw, what will happen to the font when you EXPAND the browser window?
The font size will increase as you expand it.
VW (viewport width) is a slice of the WIDTH of your browser window, so what is 4 vw?
a) 4/100th of the width of your screen.
b) 4% of the width of your screen.
c) 4vw is equal to 4 slices out of 100 of your screen’s width
d) All of the above.
d) All of the above.
When would you use Viewport Width?
For creating websites for tablets and mobile phones.
What is the viewport?
The browser window.
When creating websites or web apps for tablets or any mobile device, which unit of measure should you use?
Viewport Width (vw)
What font size type is an ‘em’?
Relative
The ‘em’ is a relative font size, but relative to what?
The base font size set for the page.