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

Design Web Typography Laying Out Type for the Web Typographic Hierarchy: Caps, Color, and Pairing Typefaces

Andre Kucharzyk
Andre Kucharzyk
4,479 Points

Drop cap - question about display type.

Normally when you set an element to be display: block, it prevents anything else sticking to it, meaning, another element will be in the next line. Why its not the case in this example?

2 Answers

Can you copy and paste the code here? It's been a little while since I watched the video, but I believe there is a float property attached to the drop cap. So, with float, it's taken out of the regular document flow.

Andre Kucharzyk
Andre Kucharzyk
4,479 Points

Yes, you are right - there is float property, but why use the block property too?

.dropcap { font-size: 5.4em; display: block; float: left; width: .8em; height: .7em; line-height: 0.8; margin: 0; }

Emmanuel Molina
Emmanuel Molina
9,268 Points

As far as I understand the display: block; isn't needed. Try to delete it and watch the result. In fact I don't even understand why he uses a class to select the first letter of the first word of the first paragraph of a section and not uses section p:first-of-type:first-letter