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

Div's problem

I can't modify 'div ids' into my CSS file such as positioning or others, no changes. This is my link attached to html "<link rel="stylesheet" type="text/css" href="css/style.css">" and it is attached but no effect when I open and start typing on CSS file.

3 Answers

Did you double check if you wrote the div in the css exact the same? How did you implement the link? Where did you save the css file?

Please insert your code here and tell us the path to the css file.

I will insert tomorrow I'm on mobile right now, my directories are fine and the link works but when I try to add some changes for some divs, doesn't work.

Ok. I think it is just a tiny problem somewhere. Maybe with the cascade or something. We'll check tomorrow :-)

Sure, thank you so much guys for the support, you are awesome and hope it is a tiny problem I am a newbie and love a lot to learn coding.

You will definitely learn. And thanks :-)

HTML

  <html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <link rel="stylesheet" href="css/style.css" type="text/css" media="screen"> 
  <title>UNTILED</title>
</head>
    <body>
<div id="TEST"></div>
    </body>
</html>

CSS

#TEST {
width:30px;
background-color: #0000FF; 
}

index.html location (site/index.html) style.css location (site/css/style.css)

This one it's just a test, and doesn't shows me nothing on browser

If this is the only css style on your in your css file, it should work just fine. Did you set the doctype to html too?

<!doctype html>

I am sitting in the university right now. I will check it by the time when I get home :-)

Yes I did that, after I changed directories and start again now works, but I still don't understand several things that seems hard for me.

I don't understand commands like "margin, padding, position and others" when I try to move different contents wherever I want. I'm such a newbie, really need help!

So you got it working? If you don't know what margin, padding etc. is, you should definitely watch the css series. Otherwise you will have huge problems in the future. Better build a good foundation instead of standing on wobbling feet :-)

P.S. normally you should add a "min-height" to the div to see changes. Otherwise the div would have a height of 0, so you would't see any changes.

Or of course, you can put some content in it ;)

I will go to css section and see what I can absorb

make sure it's writtin like this for your id's or classes

In HTML it should be:

<div id="myID">
</div>
<div class="myClass">
</div>

In css it should look like:

#myID {
}

.myClass {
}

Hope this helps!

Tried all, no results, tomorrow I will show you

Oh and make sure your selectors are right too! Depending on your content in your divs.