Sleeve Hooded Tops Long Patchwork Autum Winter Gray Pocket Outwear Solid Fashion Sweatshirt BHYDRY Mens' qnxgSwXZ8 Sleeve Hooded Tops Long Patchwork Autum Winter Gray Pocket Outwear Solid Fashion Sweatshirt BHYDRY Mens' qnxgSwXZ8 Sleeve Hooded Tops Long Patchwork Autum Winter Gray Pocket Outwear Solid Fashion Sweatshirt BHYDRY Mens' qnxgSwXZ8 Sleeve Hooded Tops Long Patchwork Autum Winter Gray Pocket Outwear Solid Fashion Sweatshirt BHYDRY Mens' qnxgSwXZ8 Sleeve Hooded Tops Long Patchwork Autum Winter Gray Pocket Outwear Solid Fashion Sweatshirt BHYDRY Mens' qnxgSwXZ8 Sleeve Hooded Tops Long Patchwork Autum Winter Gray Pocket Outwear Solid Fashion Sweatshirt BHYDRY Mens' qnxgSwXZ8
THE WORLD'S LARGEST WEB DEVELOPER SITE

HTML5 Tutorial

HTML HOME HTML Introduction HTML Editors HTML Basic HTML Elements HTML Attributes HTML Headings HTML Paragraphs HTML Styles HTML Formatting HTML Quotations HTML Comments HTML Colors HTML CSS HTML Links HTML Images Stinger Micro Boots Emu Women Beige Chestnut Hxzpqqdw HTML Lists HTML Blocks HTML Classes HTML Id HTML Iframes HTML JavaScript HTML File Paths HTML Head HTML Layout Tassel Shoulder Bags Women Handbag Leather Black Bags Crossbody Messenger Handle PU Doctor Vintage Top dqRwxzz HTML Computercode HTML Entities HTML Symbols HTML Charset HTML URL Encode HTML XHTML

HTML Forms

HTML Forms HTML Form Elements HTML Input Types HTML Input Attributes

HTML5

HTML5 Intro HTML5 Support HTML5 New Elements HTML5 Semantics HTML5 Migration HTML5 Style Guide

HTML Graphics

HTML Canvas HTML SVG HTML Google Maps

HTML Media

HTML Media HTML Video HTML Audio HTML Plug-ins HTML YouTube

HTML APIs

HTML Geolocation HTML Drag/Drop HTML Web Storage HTML Web Workers HTML SSE

HTML Examples

HTML Examples Boots Deluxe Sheepskin British with Chestnut Sheepskin Short ZpwpEnqF HTML Exercises HTML Certificate HTML Summary HTML Accessibility

HTML References

HTML Tag List HTML Attributes HTML Events HTML Colors HTML Canvas HTML Audio/Video HTML Doctypes HTML Character Sets Wolky Leather up Lace Curry shoes Black Fly 4701 20010 ppr1cZW HTML Lang Codes HTTP Messages Bag Note 10 x38cm Music 42cm litres Gym Tote HippoWarehouse Mint Type Shopping Beach p50ywTwvxq PX to EM Converter Keyboard Shortcuts

Sleeve Hooded Tops Long Patchwork Autum Winter Gray Pocket Outwear Solid Fashion Sweatshirt BHYDRY Mens' qnxgSwXZ8

Example

I am Red

I am Blue

I am Big

Try it Yourself »

The HTML Style Attribute

Setting the style of an HTML element, can be done with the style attribute.

The HTML style attribute has the following syntax:

<tagname style="property:value;">

The property is a CSS property. The value is a CSS value.

You will learn more about CSS later in this tutorial.


HTML Background Color

The background-color property defines the background color for an HTML element.

Vintage Casual Bag Robemon Satchel Women Crossbody Chain Shoulder Small Black Handbag Messenger D Clutches Fashion Ladies Xzw0q8d8x

BHYDRY Gray Pocket Sweatshirt Hooded Outwear Mens' Patchwork Sleeve Tops Solid Fashion Winter Long Autum This example sets the background color for a page to powderblue:

Example

<body style="background-color:powderblue;">

<h1>This is a heading </h1>
<p>This is a paragraph. </p>

</bodyMens' Tops Outwear Autum Sleeve Gray Long Fashion Patchwork Hooded Pocket BHYDRY Solid Sweatshirt Winter >
Try it Yourself »


HTML Text Color

The color property defines the text color for an HTML element:

Example

<h1 style="color:blue;">This is a heading </h1>
<p style="color:red;">This is a paragraph. </p>
Try it Yourself »

HTML Fonts

The font-family property defines the font to be used for an HTML element:

Example

<h1 style="font-family:verdana;">This is a heading </h1>
Tote Bag Braided Bag Bamboo Beach Tote Beach Bag Bamboo Bag Handmade Bamboo Straw L Summer black Women Handbag qxzwtU <p styleHooded BHYDRY Long Winter Tops Pocket Sweatshirt Autum Mens' Solid Outwear Sleeve Patchwork Gray Fashion ="font-family:courier;">This is a paragraph. </p>
Try it Yourself »

HTML Text Size

The font-size property defines the text size for an HTML element:

Example

<h1 style="font-size:300%;">This is a heading </h1>
<p style="font-size:160%;">This is a paragraph. </p>Marc Asphalt O'Polo Two Women's Bag Grey Retro Shoulder 17r1qH
Try it Yourself »

Winter Patchwork Long BHYDRY Fashion Tops Gray Mens' Sleeve Pocket Autum Outwear Solid Sweatshirt Hooded

HTML Text Alignment

The text-align property defines the horizontal text alignment for an HTML element:

Example

<h1 style="text-align:center;">Centered Heading Tops Fashion Patchwork BHYDRY Autum Sweatshirt Outwear Sleeve Winter Hooded Pocket Solid Mens' Gray Long </h1>
<p style="text-align:center;">Centered paragraph. </p>
Replacement DIY Bag Leather White Purse for Black as described Straps Homyl Crossbody Bag Shoulder Belts PU Wide Tv4qqd

Chapter Summary

  • Use the style attribute for styling HTML elements
  • Use background-color for background color
  • Use Sleeve Fashion Solid Gray BHYDRY Patchwork Mens' Outwear Sweatshirt Long Tops Hooded Autum Winter Pocket color for text colors
  • Use font-family for text fonts
  • Use font-size for text sizes
  • Use text-align for text alignment

Test Yourself with Exercises!

Exercise 1 »  Exercise 2 »  Exercise 3 »  Exercise 4 »  Exercise 5 »  Exercise 6 »