Prelims - Inserting CSS Flashcards

1
Q

There are three ways of inserting a style sheet

A

External CSS
Internal CSS
Inline CSS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

External styles are defined within the < > element, inside the < > section of an HTML page

A

<link> element, <head> section

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="mystyle.css">
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what tag do we use to link css style sheet?

A

<link>, <href>

<link rel="stylesheet" href="mystyle.css">
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The internal style is defined inside the ____ element, inside the head section

A

“<style></style>”

<!DOCTYPE html>
<html>
<head>
<style>
body {
  background-color: linen;
}

h1 {
  color: maroon;
  margin-left: 40px;
}
</style>
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

may be used to apply a unique style for a single element

A

Inline styles

<!DOCTYPE html>
<html>
<body>

<h1 style="color:blue;text-align:center;">This is a heading</h1>
<p style="color:red;">This is a paragraph.</p>

</body>
</html>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly