Answer:
{ }.selector {
property: value;
}
color or font-size.red, 18px, etc.Answer:
h1 {
color: green;
}
This styles all <h1> headings to appear in green color.p {
text-align: center;
}
This centers the text in all paragraphs (<p> tags).Answer:
color or font-size.blue for color or 16px for font size.property: value;
p {
color: red;
font-size: 16px;
}
color: red; changes the text color to red, and font-size: 16px; sets the font size to 16 pixels.Answer:
{ }.;.h2 {
color: red;
font-family: Arial;
font-size: 20px;
}
<h2> element with red color, Arial font, and font size 20 pixels.Answer:
{ }, property names, values, and semicolons ; prevents errors in webpage formatting.Answer:
CSS rule:
p {
color: blue;
background-color: yellow;
font-size: 18px;
}
Explanation:
p targets all paragraph (<p>) elements in the HTML document.{ ... } contains three declarations.color: blue; changes the text color inside paragraphs to blue.background-color: yellow; sets the background of the paragraphs to a yellow color.font-size: 18px; increases the size of the text in pixels to make it more readable and visible.Answer:
p
color: green
font-size 14px
Identify the errors and correct the CSS while explaining why each correction matters.
Answer:
Errors identified:
{ } around the declaration block.: between font-size and 14px.; at the end of declarations.Corrected CSS:
p {
color: green;
font-size: 14px;
}
Explanation:
{ } enclose the declarations for the selected elements. Without them, the browser cannot understand where the block starts and ends.: is necessary to separate property and value; missing it makes the statement invalid.; mark the end of each declaration; missing semicolons may cause browsers to ignore the next property.<h1> headings should appear green but only some headings appear green while others don't, what could be the possible CSS syntax or usage errors? How would you fix it?Answer:
Possible errors:
h1).{ } around declarations.; after the color property.Fixes:
h1 { color: green; }<link> tag in the HTML <head>.Answer:
; in CSS syntax acts as a separator between declarations within the declaration block.