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 Treehouse Club: HTML Publish a Story The Head

Johnny Breen
Johnny Breen
701 Points

How is the size of the font determined in the title and subtitle?

I'm talking specifically about the bit 'Peg Leg' and 'By Joy Kesten' in the example code.

I can see how basically everything else gets setup, but how is the font size decided for those in the title, subtitle and then the body section?

Thanks for any help you can provide me with!

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

We use heading tags not only to display an important part visually, but also to give importance to that bit. This is valuable to screen readers for visually impaired so that it knows which parts are important. The browser itself has default font-sizes for these, which is what you're seeing being used here. Keep going on the path you're going and you'll soon learn how to adjust these sizes yourself!

anil rahman
anil rahman
7,786 Points

If you notice those headings you are on about are wrapped in

<h1></h1> and <h2></h2>.

These mean create heading of size heading 1 and another heading of heading size 2. http://www.w3schools.com/html/html_headings.asp

The rest is all standard browser styling so the body tag will have the usual browser styling the heading tag will get the heading font size and default browser styling.

Then she added some internal styling of her own to centre them and change colour.