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.

CSS

Bottom border spans across the page

Hi Everyone,

For some reason, the bottom border of my .callout class seems to span across the page, rather than just under the text.

The CSS is written as the following: .callout { font-size: 1.25em; border-bottom: 3px solid; margin-top: 20px; padding: 10px 10px; display: inline-block;

(http://port-80-erao6htxx6.treehouse-app.com/), not sure if that link is accessible :) )

Could you possibly help me understand why this is happening?

Kevin D
Kevin D
8,621 Points

Looks like it's inheriting the styling from the <a> tag. It's overriding the display:-inline-block; to just display: block;

So just take out the display: block; from the <a> styling and it should work!

http://stackoverflow.com/questions/9189810/css-display-inline-vs-inline-block

4 Answers

Amazing :)... Thanks for this, Kevin... That's so helpful!!

Kevin Dang appears to be correct. If you remove the

a:link {
  display:block;
}

property from your css you should be good

Can, I just ask though (and excuse my ignorance)... As I've only added the .callout class later within the CSS, shouldn't it overide the a:link { display:block;}? I simply assumed this as it's cascading?

Thank you Kevin. That's very helpful... I'm still just a tiny bit confused as to why it matters about the previous css statement, as the later statement in the CSS and therefore automatically overrides the previous statement no?

http://port-80-erao6htxx6.treehouse-app.com/

Kevin D
Kevin D
8,621 Points

Yep you're right! So the 'later' the styling, the more priority it should have. If you do this:

a.callout {

}

instead of just:

.callout {

}

it will work the way you're thinking!