Google+ logo Twitter logo Youtube logo

Tags - Attributes

Tags and attributes

You have now become acquainted with a number of tags. Below an unordered list (<ul&) treated with all treated tags;

  • <h1> - <h6> Tag for headings
  • <p> Tag for paragraphs text
  • <br> Tag for a new line
  • <strong> Tag for making text bold
  • <em> Tag for making text italic
  • <u> Tag for making text underlined
  • <ul> Tag for an unsorted list (like this one!)
  • <ol> Tag for a sorted list (just like this one, though each item would have a index prepended)
If any if the previous tags are not clear, please feel free to browse back.

Some tags have attributes. An attribute is like a extra option (or feature) that the tag you can use. We have not treated the tag for a image yet, but this is an excellent example of how an attribute works.

An image is marked with a <img> tag. However, the tag must still "know" what picture to show. We can specify an attribute, named: src. For example, showing image house.jpg in HTML can be done like this;

An image tag can have several attributes more, let's checkout some basic attributes;
  • src The filename of the image
  • width The width (in pixels) of the image
  • height The height (in pixels) of the image
Every tag can have multiple attributes. Say; we want to show an image just like aboven; but then with dimensions 100 pixels by 100 pixels;

Note: Src, width and height are attributes. Not every tag has the same -possible- attributes; e.g. a <strong> tag can't use a src attribute. After all; it isn't a image.

Leave a comment ...

Name (will be visible)
E-mailaddress (will not be shown)
Type the code illustrated below

Back to top