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

Kasim Khan
Kasim Khan
4,925 Points

ID selector

On the mobile-first video, nick puts the ID selector in the anchor element

<a href="webpage.html" id="logo">

however in the previous video he used a div for the wrapper

<div id="wrapper">

</div>

Why did he not use a div this time?

1 Answer

An ID should always be unique. When you want to style a specific div with an ID, you can use that ID as a selector. If you use div as a selector, then the styling will be applied to al divs on that page.