HTML Tags Tutor
Style Tag
The style tag is placed in the head section of an HTML document. It is used to place embedded style sheets.
<head>
<style type="text/css">
{ }
<style>
</head>
Style settings can also be defined using the style attribute and adding it to most html tags.
Because of the limitations of our editor, this is the method we'll use in our tutorials.
Lesson stepsClick the <> button to enter your code Type the code shown here for an H1 header tag in the editor window: |
Add Font FamilyClick the <> button to return to the code. Add the inline style code to the opening h1 header tag as shown in red: |
Add Font SizeClick the <> button to return to the code. Add additional code as shown in red: |
Add Text AlignClick the <> button to return to the code. Add additional code as shown in red: |
Add Text ColorClick the <> button to return to the code. Add additional code as shown in red: |
Lesson Notes
When adding inline style declarations, use a semi colon to separate them. If these same declarations were defined in the head section using the style tag the code would look like this:
<head>
<style type="text/css">
h1 {
font-family: arial;
font-size: 14pt;
text-align: center;
color: #ff0000
}
<style>
</head>

