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

Evan Hughes
Evan Hughes
1,749 Points

Straight quotes vs. curly quotes

I was doing a CSS course last night and my code would not work. I scoured the video and all of my code matched exactly with Guil's, but it still did not work. I finally discovered in one spot I had a value that had straight quotes at the beginning and curly quotes at the end. Deleting the curly quotes and changing them to straight fixed the problem.

I was using Sublime Text 2. How could I have managed to get random curly quotes in the first place? Why don't they work together and is there a use for the curly ones?

2 Answers

Ahh, got ya. Curly quotes are used more for writing, I believe; they are a special character, which I don't think is used for coding, that I know of anyhow. The only time I think you'd really use it while coding HTML, would maybe be to add emphasis to a quote with an entity code. If you're using a different type of keyboard, or use the curly quote in writing, it does make a difference apparently.

P.S. To include that image, simply right-click and copy the image URLβ€”it's http://i.imgur.com/ZPNIkuF.png

Curly vs. Straight Marks

Evan Hughes
Evan Hughes
1,749 Points

I see from that page that they are a "special character" rather than a standard one. I still can't figure out how they showed up, but at least now I know to check those if I run into that in the future! Thanks!

Hi Evan, it sounds like you might have been on the Advanced Selectors section. The opening and closing brackets [ ] are for targeting specific strings and values. The curly braces { } are used for the start and end of a declaration, e.g., { color: blue; }.

The brackets are just a way for the rendering engine to understand what you're trying to select in your CSS.

Evan Hughes
Evan Hughes
1,749 Points

I do understand the difference between the brackets and the braces, but this was a problem with the quotation marks. Instead of two small, straight ticks I had two curved quotation marks, which apparently Apple calls "smart quotes." Here's an example of how they are different:

straight quotes vs smart quotes

I can't seem to get the image to work here, but here is the link: http://imgur.com/ZPNIkuF

I copied and pasted some "smart quotes" I found online, so I have no idea how to replicate them in Sublime itself.