Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS How to Make a Website Customizing Colors and Fonts Resize Text

Natalia P.
Natalia P.
353 Points

Do you have to put a "0" in front of a decimal point? 0.32 vs .32?

h1 {
  font-family: 'Changa One', sans-serif;
  margin: 15px 0px;
  font-size: 1.75em;
  font-weight: normal;
  line-height: 0.8em;
}

h2 {
  font-size: 0.75em;
  margin: -5px 0 0;
  font-weight: normal;
}

*This question applies to any decimal value I guess and not just to font-size. In this example it also applies to line-height.

Anyways, the font-size for h2 is 0.75em and appears as red markup in my worksheet css file. If I change it to .75em it turns blue and the same happens with all other values that have a "0" in front of the decimal. Does getting rid of the "0" have any effect (((sorry, I can't resist but on a rather far side-note, I cannot figure out if I would use "effect" or "affect" in this situation? any grammarians?))) on my website? I did not see any effect after trying it out but one never knows if in the future it might sacrifice the website's integrity and down the road effect something.

What is the difference between blue and red highlight in the worksheet code writer?

2 Answers

Hi Natalia,

Leaving the '0' out of a decimal value (like .75em) saves time when writing code, which is probably what the coding exercise is trying to convey. However, both methods will work just fine outside of Treehouse.

Also, you are correct in using 'effect' in your sentence :-)

Natalia P.
Natalia P.
353 Points

Thanks Zachary,

Do you know why workspaces highlites the code in blue if it's without the '0' and red if it has one before a decimal? In the video the exercise actually uses the 'O' before the decimal point and made no mention about it it.

Thanks!

Hi Natalia,

Here's the part of the specification that tells you it's ok to leave it off -

From 4.3.1 Integers and real numbers: (emphasis mine)

Some value types may have integer values (denoted by <integer>) or real number values (denoted by <number>). Real numbers and integers are specified in decimal notation only. An <integer> consists of one or more digits "0" to "9". A <number> can either be an <integer>, or it can be zero or more digits followed by a dot (.) followed by one or more digits. Both integers and real numbers may be preceded by a "-" or "+" to indicate the sign. -0 is equivalent to 0 and is not a negative number.

So you don't have to have any digits before the decimal point and you must have at least 1 digit after.

I don't use workspaces so I can't answer your question about the highlighting.

Jason Anello ,

What's the markdown to put the bar on the left side here?

Jeff

Hi Jeff,

It's the greater than sign > This will create a <blockquote> and then the bar is just Treehouse's choice of styling for the blockquote.

Dustin Matlock did a great writeup on markdown syntax here: https://teamtreehouse.com/forum/howto-guide-markdown-within-posts

I don't know if you came across it or not. It has examples of the blockquotes and nested blockquotes as well as anything else you might need to do. In the examples there you'll see a greater than sign on every single line but it's not always strictly necessary to do that.

In my case above I was posting a single continuous piece of text and I was able to get away with a single > at the beginning.