Step 8 | HTML Basics

Art 354 | Web Design

HTML Text Tagging

An HTML element usually consists of a start tag and end tag, with the content inserted in between.
example: <tagname>Content goes here</tagname>


The HTML element is everything from the start tag to the end tag.
example: <p>My very first paragraph.</p>


There are several title (headline) types when using HTML tags.

<h1> through <h6>
<h1></h1> is the largest
<h6></h6> is the smallest
All are all bold by default.

We can change the default size and weight of these titles using CSS code.

We can also tag body copy. This is done by tagging it as a paragraph.

example: <p>body copy goes here</p>

There are several other ways to stylize type using html tags. Other tags include:

- <i></i> for italic

- <em></em> This stands for emphasis. It is visually identical to italic, but more important to search engines

- <b></b> for bold type

- <strong></strong> This is another way to represent bold type. Again, visually identical but also more important to search engines


About Compound Rules

We can stylize these different tags to appear different depending on which box they sit in. This is done by making compound CSS rules. For example, instead of making a generic rule for all h1 text we can make different rules for h1 in different boxes. These could include header, main, aside, footer, etc.

The compound rule would look like this…

header h1 {

           font-family: your choice here;

           font-size: your choice here;

           font-weight: your choice here; : your choice here;

}


main h1 {

            font-family: a different choice here;

            font-size: a different choice here;

            font-weight: a different choice here;

            color: a different choice here;

}

aside h1 {

             font-family: a third choice here;

             font-size: a third choice here;

             font-weight: a third choice here;

             color: a third choice here;

}


footer h1 {

              font-family: a forth choice here;

              font-size: a forth choice here;

              font-weight: a forth choice here;

              color: a forth choice here;

}


Inline CSS Style

Next we can also change the appearance of the text by using inline CSS coding. This would allow us to make many general rules, but occasionally change some specific text with some inline CSS style code.

An example of that would be…

<p style="color: blue; font-weight: 800;">Paragraph text goes here.</p>


The Use of the Span Tag

Lastly, to change the appearance of text we could use the <span> tag.

An example being…

<p>This is a <span>paragraph</span></p>

the CSS code would be used in the attached style sheet would look like this…

p span {

             font-family: a forth choice here;

             font-size: a forth choice here;

             font-weight: a forth choice here;

             color: a forth choice here;

}