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

Shorthand overrides previous properties?

It appears that if a shorthand property is omitted:

background: #ffa949 url('../img/mountains.jpg') no-repeat center;

(in this case background-size: cover) that the shorthand will apply the default background size whether or not it was entered. So if you want to apply 'cover' it must come after the shorthand rule.

Is this true and if so does it apply to all shorthand?

1 Answer

Yes background-cover needs to be placed after the shorthand property or it will not work. As far as other shorthands, its probably best to keep the shorthand priority placing additional related properties below.

Thank you nik. I suspected this but wasn't 100% sure. Also letting others learn from my mistake.