|
Head First HTML and CSS ( PDFDrive )
you are here
4
29
the language
of the
web
Meet the style element
To add style, you add a new (say it with us) E-L-E-M-E-N-T
to your page—the
Starbuzz Coffee Beverages
House Blend, $1.49
A smooth, mild blend of coffees from Mexico, Bolivia and
Guatemala.
Mocha Caffe Latte, $2.35
Espresso, steamed milk and chocolate syrup.
Cappuccino, $1.89
A mixture of espresso, steamed milk and milk foam.
Chai Tea, $1.85
A spicy drink made with black tea, spices, milk and honey.
Starbuzz Coffee Beverages
House Blend, $1.49
A smooth, mild blend of coffees from Mexico, Bolivia and
Guatemala.
Mocha Caffe Latte, $2.35
Espresso, steamed milk and chocolate syrup.
Cappuccino, $1.89
A mixture of espresso, steamed milk and milk foam.
Chai Tea, $1.85
A spicy drink made with black tea, spices, milk and honey.
element. So
when you set the font to sans-serif, you’re
saying that the default font within the body of
your page should be sans-serif.
We’ll go into a lot more detail about how
CSS works shortly, so keep reading. Soon,
you’ll see that you can be a lot more specific
about how you apply these rules, and by
doing so, you can create some pretty cool
designs.
you are here
4
33
the language
of the
web
Write the HTML for the “mission.html” page below, and then
add the new CSS.
Update your “mission.html” file to include the new CSS.
Once you’ve done that, reload “mission.html” in your browser.
Make sure your mission page looks like ours at the end of the
chapter.
1
2
3
4
Now that you’ve put a little style in the Starbuzz “index.html” page, go ahead and
update your “mission.html” page to have the same style.
34
Chapter
1
content
and
style
Greetings, CSS; I’m glad you’re here because I’ve
been wanting to clear up some confusion about us.
Really? What kind of confusion?
Lots of people think that my tags tell the browsers
how to display the content. It’s just not true! I’m all
about structure, not presentation.
Well, you can see how some people might get
confused; after all, it’s possible to use HTML
without CSS and still get a decent-looking page.
“Decent” might be overstating it a bit, don’t you
think? I mean, the way most browsers display
straight HTML looks kinda crappy. People need
to learn how powerful CSS is and how easily I can
give their web pages great style.
|
|