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

still need help with main.css

```css a { text-decoration: none; }

wrapper {

max-width: 940px; margin: 0 auto; background: orange; }```

I need to know why this is wrong and will not execute on my workspace. The hashtag is there, I do not know why it does not show here. also, I do not know why this is showing my code in such a weird way ???

12 Answers

Luke Buśk
Luke Buśk
21,598 Points

Patti,

I would advise You to either:

a) Download Sublime Text 2 or any other text editor. Write Your code there. Remember to name main file "index.html", other file "style.css" and link css to Your html. Launch index.html in a Chrome browser and check if everything is working as it should.

b) Use codepen and paste the code there, then give us a direct link to it to we can see what is wrong (or You it can work without problems).

The point is, sometimes workspace behaves weird and can not display something even tho You did everything correct. By following either a) or b) You will make sure if its an error on Your end or software.

Cheers.

What is your question?

I guess is:

#wrapper {
text-decoration: none;
max-width: 940px;
margin: 0 auto;
background: orange;
}

or if the wrapper is a class then:

.wrapper {
text-decoration: none;
max-width: 940px;
margin: 0 auto;
background: orange;
}
Luke Buśk
Luke Buśk
21,598 Points

Check the code outside of workspace, use text editor and index.html with browser. Workspace is known for giving much trouble.

css a { text-decoration: none; } #wrapper { max-width: 940px; margin: 0 auto; background: orange; }

Marcelo, this is what the instructor told us to input! the text decoration code worked and all is well. My question is, why does the next part not work ???

Put the link of the challenge.

This is how you must place your code:

Wrap your code with 3 backticks (```) on the line before and after. If you specify the language after the first set of backticks, that'll help us with syntax highlighting.

Focus on this:

"Wrap your code with 3 backticks (```) on the line before and after...""

You are writing the backticks in the same line of your code.

Ok, let me try again. I am such a novice at this !!!

a {
  text-decoration: none;
}
 #wrapper {
  max-width: 940px;
  margin: 0 auto;
  background: orange;
}

Also, Marcelo, I have not made it to the challenge yet. I am still listening to the instruction tape called Center the Wrapper.

Marcelo,

Where did you disappear too ??

Hi Patti,

You mentioned that text-decoration: none; was working so that means you have your css file linked properly.

There isn't anything wrong with your #wrapper css

My only suggestion at this point would be to paste in your html that you have. You may have something wrong with your id attribute that would cause the styles to not take effect.

Your opening div tag should look like this: <div id="wrapper">

Thanks, Jason

Jason, my div looks just like yours, except, my closing symbol is further down the page as per the instructor instructions. So, if my div is correct and my text decoration is right, why won't the next little section work ??? I am still listening to the video. I am not in the challenge !! and I use windows !!???

Luke Buśk
Luke Buśk
21,598 Points

Are You doing the code challenge or You are writing this code in WORKSPACE?

Hi, Luke I am not at the challenge yet. I am in Workspace and still listening to the instructor. And I use Windows. Look in the above answers to see what I coded, if you will, cause I can't seem to get my workspace to open right now. Thanks

Thanks, Luke Now how do I do what you have suggested ---- I am only a novice and most of this is greek to me !!???

Luke Buśk
Luke Buśk
21,598 Points

Okay then we gonna make it a bit more simple:

1) Go there http://www.sublimetext.com/ and download this text editor (unless You are using or prefer different one). 2) Then next to the course video, on the right You can see "Project Files". Download this. 3) Unzip and open index.html and main.css in Sublime Text 2 and read the code. 4) You can change things in main.css and after saving and reloading the index.thml in Your browser You can observe the changes.

That way You can excercise in "real world" enviroment and direcly in Your browser. You can compare that code to the one in Workspace or just continue practising in sublime text 2 + any browser by downloading project files or creating Your own from scratch and following the lessons.

I hope that helps.

Thanks Luke, again !!! I mulled this whole thing over this morning. I just realized I had a closed div, where it did not belong !!!!! Now, All is well !!! Thanks for your patience !!