The importance of semicolons


#1

I don't understand what I got wrong? Codecademy keeps saying that I didn't fix the h3 font-family and that it should be Verdana.

https://www.codecademy.com/courses/web-beginner-en-TlhFi/1/4?curriculum_id=50579fb998b470000202dc8b

This is my code:

h3 {
	 font-family: Verdana
	 color: blue
}

p {
	font-family: Garamond
	font-size: 16px
{


#2

@codequeen2016,

In CSS the semi-colon-; should be seen as a property-separator
https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started
https://developer.mozilla.org/en-US/docs/Web/API/CSSRule

In these exercises they want you to define CSS-Rules

A CSS-Rule consists of

  1. a selector
  2. one or more properties encapsulated in a pair of curly-brackets-{ }
    • each property consisting of a property-key and an associated Value
    • the properties are separated from each-other by a semi-colon-;

Thus if you defined the CSS-Rule h3 in your style-sheet.css
like

h3 {
    font-family: Verdana;
    color: blue
}

OR
like

h3 { font-family: Verdana; color: blue }

you have defined a h3-Rule
consisting of 2 properties separated from each-other by a semi-colon-;
a font-family property with property-key font-family and an associated symbol Value Verdana
a color property with property-key color and an associated symbol Value blue

Now change your CSS-Rules
adding the required semi-colons
and properly closing the rules........


#3

Thanks @leonhard.wettengmx.n. It worked.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.