O'Reilly logo

Raspberry Pi For Dummies by Mike Cook, Sean McManus

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Formatting Your HTML Content

After you have the framework in place to build your web page, it’s time to consider how to format the text and images there.

remember.eps In each case, the content and its formatting should be put between the <body> and </body> tags of your web page.

Adding additional headings

We used <h1> and </h1> to mark up the most important heading on the page, but we can have subheadings on the page too, marked up with <h2> and </h2>.

Our web page has two subheadings, for a section about Sean’s latest trip and for a section of travel photography tips. You can mark these up like this:

<h2>My latest trip</h2>

<p>Paragraph for the latest trip section goes here</p>

<p>Second paragraph in latest trip section</p>

<h2>My top tips for travel photography</h2>

<p>Top tips go here</p>

You can add more subheadings too. If you want to subdivide the latest trip section or the top tips section with headings, use <h3> tags to mark up the headings inside it. If you have a particularly complex document, you can use heading levels all the way down to <h6>, but it’s probably smarter to look at reorganizing that information so the web page isn’t so long.

Adding images to your web page

Pictures are a great way to liven up a web page and help you to get your message across. We’re going to use two pictures on this page: a wide panoramic shot as a banner across the top to give the site a visual identity, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required