Exam code: 0417 & 0983
1/170Still learning
Know0
Was this flashcard helpful?
Define CSS.
CSS, or Cascading Style Sheets, defines the style or appearance of a webpage.
Where can CSS be placed?
CSS can be placed within the HTML or externally in a file.
Define attached stylesheet.
An attached stylesheet is a separate CSS file that is linked to the HTML page.
Give two benefits of an attached stylesheet.
It can be edited separately from the HTML, and the same styles can be reused across multiple pages.
Why are relative file paths used for attached stylesheets?
They refer to the location of the CSS file relative to the current HTML file, which makes the code more portable and easier to manage.
Define inline stylesheet.
An inline stylesheet is written directly within an HTML tag using the style attribute, and applies only to the page it is written into.
What is the cascading order, from highest to lowest priority?
Inline styles inside an HTML element, then external and internal styles in the head section, then the browser default.
True or False?
An external stylesheet overrides an inline style.
False.
The style closest to the element takes priority, so an inline style overrides the external stylesheet.
What do CSS styles control?
Styles control the visual properties of an element in the body of a webpage, such as backgrounds, fonts and tables.
Which properties set a background colour and a background image?
background-color sets the background colour and background-image sets a background image.
Name three font properties in CSS.
Font properties include font-size, font-family, color and text-align.
Which property makes table borders appear as a single line?
border-collapse: collapse; makes borders appear as a single line.
What is the difference between padding and border-spacing?
padding defines the space between the cell content and its border, while border-spacing controls the space between cells.
Which properties set horizontal and vertical alignment?
text-align sets horizontal alignment and vertical-align sets vertical alignment.
Define CSS class.
A class allows styles to be grouped together and applied to multiple elements, acting as a reusable template.
How is a class defined and then applied?
A class is defined using a period (.) followed by the class name, and applied to an element using the class attribute.
If the CSS file sits in a subfolder named css, the relative path is .
If the CSS file sits in a subfolder named css, the relative path is "css/styles.css".
By signing up you agree to our Terms and Privacy Policy