04.06.2013 Views

Head First HTML with CSS

Head First HTML with CSS

Head First HTML with CSS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

etter looking blogs<br />

#10 Blogs<br />

Weblogs – or “blogs” as they are commonly known – are like personal Web pages, except<br />

they are written in journal style, like Tony’s Web journal. Many people who create blogs<br />

use online services that take care of the details of managing the blog entries. These services<br />

also provide pre-made templates that allow you to pick from a variety of looks for your blog.<br />

They offer different background colors, font styles, and even background images you can use.<br />

But they also allow you to customize your blog template and create your own unique look for<br />

your blog, <strong>with</strong>, you guessed it – X<strong>HTML</strong> and <strong>CSS</strong>.<br />

Here’s a snippet of X<strong>HTML</strong> and <strong>CSS</strong> from the blog template of a popular online blogging<br />

service, Blogger.com. As you can see, they’re using all the same elements and properties<br />

you’ve learned about in this book. And they’re even on top of the new standards: their<br />

templates use X<strong>HTML</strong> 1.0 Strict, so it’s a good thing you’ve learned how to write strict<br />

X<strong>HTML</strong>, right? Let’s take a closer look...<br />

<br />

<br />

<br />

<br />

<br />

<br />

body {<br />

margin: 0px;<br />

padding: 0px;<br />

text-align: center;<br />

color: #554;<br />

}<br />

.<br />

.<br />

.<br />

<br />

<br />

<br />

.<br />

.<br />

.<br />

<br />

<br />

650 Appendix<br />

This blogging service uses X<strong>HTML</strong> 1.0<br />

Strict, so here’s the DOCTYPE and<br />

attributes you’ve seen before.<br />

These s are template variables; they are filled in <strong>with</strong><br />

the name of your blog and other content when you create<br />

your blog, and whenever you add a new post. You should<br />

leave these variables like they are, as they’re needed to<br />

correctly display your blog content.<br />

Here’s the top of the style sheet that gives your blog its look.<br />

This template is removing the margins and padding from the<br />

body, giving the text a default color, putting an image in the<br />

background of the page, and setting font properties.<br />

background: #689C54 url(http://www.blogblog.com/dots_dark/bg_minidots.gif) top center repeat;<br />

font-family: “Lucida Grande”, lucida, helvetica, sans-serif;<br />

font-size: small;<br />

There are lots more style rules here. Each style<br />

rule controls things like the font used for your<br />

blog entries, the headings, the colors,... in other<br />

words, all the same stuff you’re used to styling now.<br />

The X<strong>HTML</strong> contains all the parts you need for<br />

your blog: headings, entries, dates, etc. Each<br />

content area will also have a variable for<br />

plugging in the content from your post.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!