Lesson 2

Home

Images

Orange and black bird perching on branch

This is an image of a bird. It uses the src, width, height, and alt attributes.

Dark-colored dog in the grass

This is an image of a dog. It uses the src, width, height, and alt attributes.


Links

Google Example.com

Block and Inline Elements

Headings are block elements (see above).

Hello World

Hello World

The P and the DIV elements are both block elements, and they will always start on a new line and take up the full width available (stretches out to the left and right as far as it can).

Inline elements don't start on a new line. They only take up as much width as necessary. For example, bold, italic, and underline are all inline elements.

You can also style inline elements however you want, with a span element like this.


Style Attribute

This is a heading

This is a paragraph.


Span Element

An inline container used to mark up a part of a text, or a part of a document.

My mother has blue eyes and my father has dark green eyes.

Hello world! My name is John Doe.


Div Element

Defines a division or a section in an HTML document

Used as a container for HTML elements, to be further styled

Always a line break before and after a div element

Div is much like span, but div is a block element.


Previous Page Next Page Activity Demo Next lesson