36 terms

HTML and CSS

CSS Study set based on w3schools.com
STUDY
PLAY
What is the CSS syntax?
selector declaration declaration
h1 {color:blue; font-size:12px;}
property:value
What is the syntax for writing comments in CSS?
/ This is a comment /
What is the id selector and how is it defined?
The id selector is used to specify a style for a single unique element. The id selector is defined with a #.

#idExample
{
text-align:center;
}
What is the class selector and how is it defined?
The class selector is used to specify a style for a group of elements. Unlike the id selector the class selector is often used on several elements. THe class slelector is defined with a .

.classExample
{
text-align:center;
}
You can specify that only specific HTML elements be affected by a class. Give an example of how.
p.classExample
{
text-align:center;
}
What are the three ways to insert a style sheet (in cascading order)?
• linking and external style sheet
• inside the head of a document
• inside and html element
background
sets all the background properties in one declaration
background-attachment
sets whether a background image is fixed or scrolls with the rest of the page
background-color
sets the background color of an element
background-image
sets the background image of an element
background-position
sets the starting position of a background image
background-repeat
sets how a background image will be repeated
What is the order for background - shorthand property
• background-color
• background-image
• background-repeat
• background-attachment
• background-position
For W3C compliance, if you define the text color you must also define:
the background-color property
text-alignment is used to set:
the horizontal alignment of text.
Text can be centered, aligned left or right and justified
text-decoration
used to set or remove decorations from text.
(removing underlines form links, adding line-throughs, etc.)
text-transform
used to specify upper or lowercase in a text. Can be used to turn everything into upper or lowercase or capilize the first letter of each word.
text-indent
used to specify the indentation of the first line of text
List all the CSS text properties (13 total)
color
direction
letter-spacing
line-height
text-align
text-decoration
text-indent
text-shadow
text-transform
unicode-bidi
vertical-align
white-space
word-spacing
to avoid font sizing issues accross browsers you should specify size with what unit?
Em (recommended by W3C)
The font size solution that works in all browsers is:
to set a default size to 100% in the body element and then use Ems though out the rest of the document
font
sets all the font properties in one declaration
font-family
specifies the font family for text
font-size
specifies the font size of text
font-style
specifies the font style for text
font-variant
specifies whether or not text should be displayed in small-caps font
font-weight
specifies a weight of a font
HTML
Hyper Text Markup Language
HMTL tag for largest heading
<h1>
line break
<br>
Bold
<strong> <b>
Insert an image
<img src="image.jpeg" alt="My image">
paragraph
<p>
hyperlink
<a href="http://www.google.com">Google</a>
Numbered list (ordered list)
<ol>
Bulleted list (unordered list)
<ul>
YOU MIGHT ALSO LIKE...