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 CSS: Cascading Style Sheets Take a Mobile-First Approach

I noticed that some css codes that I write don't do much, if at all, is it because I'm working using google chrome?

like in: max-width: 940px;

from the previous lesson, and now the same thing in this lesson:

text-align: center;

Nothing happens, and everything is almost in their same position.

Hi there Hammam,

Well you have to be careful in your CSS declarations: don't forget CSS stands for "CASCADING" style sheets.

So the first thing to check is your code: notice that declarations selecting the same "id" or "class" selector -> the last declaration will take precedence over the one that was declared before the last one.

Secondly make sure you are selecting the right selector: if the selector has a declared class or id you can select that tag directly, but if you want to generally style any of the HTML tags you must do so by respecting the tag hiearchy and nesting.

To further help you please post the code that's giving you problems and I'm sure we could provide a more precise answer and explenation.

2 Answers

Hi Hammam,

Chrome actually has some of, if not thee, most up-to-date CSS and HTML support. I do not believe this is the reason.

Keep in mind, the max-width property will only make a noticeable change in your layout when you have content that exceeds 940px in width within the content area of the element you are declaring the max-width property for.

As Nejc said, consider the hierarchical flow of your CSS rules, other formatting you've applied to parent elements may make the text-align: center appear to not change much.

For further assistance please supply the HTML and respective CSS declarations

MIftakhul Farikhin
MIftakhul Farikhin
1,857 Points

yeah,it's true.i try making css in chrome,but it's not working.but in my mozilla browser working.i dont know why