Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML Introduction to HTML and CSS Make It Beautiful With CSS Select and Style by Class

card-title class the css rules won't take effect after i refresh the browser

hi after creating the class card-title and added the styling, the changes won't take effect on my browser

12 Answers

Agnes Demes
Agnes Demes
6,612 Points

thats ok, my pleasure ... I think here the code editor needed help :) have a great day

Thank you, Agnes! I was having the same issue and voila! I was able to refresh and "Background" was centered.

Agnes Demes
Agnes Demes
6,612 Points

everything seems fine, hmmmm I just went and tired myself to do the same and it worked. The only thing I can really think of is - not saving the file by SAVE ALL but SAVE only the current page would cause this.

Jason Mendez
Jason Mendez
6,630 Points

This comment worked for me. I had a similar issue, and what I've concluded is that simply using "Save" while on styles.css only saved the code on styles.css, but not the work I'd done on index.html, so I believe the code on styles.css wasn't being applied to the new html code when I refreshed. After using "Save All" instead, it worked perfectly.

Thanks for SAVE ALL. It SAVED ME!

Thank you! save all worked for me

Save All worked for me. Super grateful!!!

hi agnes thank you very much for the speedy response. please find below, the copy of mu html and css .card-title { text-align: center; border: solid black 3px; border-radius: 10px; }

<main class="flex">
  <div class="card">
    <h2 class="card-title">Background</h2>

my thought exactly agnes, it seems all my class attributes don't work, because i tried to remove the classes and styled just the tag, and guess what? when i ran the browser , the styling worked. it's getting me worried. But on a positive note, i seem to be getting all the questions about classes right.

Agnes Demes
Agnes Demes
6,612 Points

Hi, sometimes it does take a little longer then expected for some browsers to catch up. Things you can try, save all changes in files, re-launch preview and check css file that the dot . is infront of card-title. If you are still having trouble please post a copy of your html and css code .

Agnes Demes
Agnes Demes
6,612 Points

do you have another code editor where you can try it as well? try getting atom or a free version of visual studio. Yes your code seem good and if you getting all the answers right then or try the h2.card-title{} specific taget style.

yes i do have atom, everything loads very well with it. perhaps, the problem could be with the workspace. thank you agnes for helping me.

thank you, enjoy your day.

chris Wrangles
chris Wrangles
585 Points

I'm having the same problem

Lauren Niedergang
Lauren Niedergang
1,337 Points

Hitting "Save All" instead of "Save" worked for me.

leonardo abreu
leonardo abreu
535 Points

Thanks it work for me also!!

David Lloyd
David Lloyd
2,800 Points

Not working for me either.

.card-title { text-align: center; border: solid black 3pc; }

<main class="flex"> <div class="card"> <h2 class="card-title">Background</h2>

Hello, Im having the same problem. I cannot get it to center

The "Save All" comment worked for me too. Ahhhhh crisis averted :)