devXero's blog

a blog about agile, development, and automation

HTML Part 2 (Containers)

Posted by Mike Longin on October 4, 2009

For part 2 we are going to look at a few different container types and tables.

First some container types you may experience:

  • DIV
  • SPAN
  • P

Each of these are common containers you may come across.  They each have some common similar attributes:

  • InnerHTML – This is the area between the open and close tag.
    • Example: <DIV>This is the innerHTML </div>
  • InnerHTML is ALL of the HTML between the tags, including pieces of other tags
    • Example:<DIV><SPAN>This is some text</SPAN></DIV>
      • The innerHTML of the div is “<SPAN>This is some text</SPAN>”
      • The innerHTML of the span is “This is some text”
  • Id
  • Name
  • Class

What is important about any container is that it usually contains additional tags.  Below is an example you may come across:

 

<div>
<span>This span contains some text</span>
<div>
This div contains some text and
<a>a link </a>
</div>
</div>

 

Containers are prevalent through any application but with CSS (style sheets) make them even more important.

Another type of container is a Header container.  There are a couple you may come across but the most common are:

  • H1
  • H2
  • H3

These are commonly used to create common types of headers on a page.  When it comes to attributes they are treated the same as the containers we looked at above.

The next type of HTML we will look at are tables.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: