You are currently browsing the page Basic tags in the HTML category.

Basic tags

This page is about all the basic tags used in a webpage. For example, to insert a link or an image, etc.

Text styles

  • <p></p> will produce a paragraph.
  • <br /> inserts a line break.
  • <b></b> or <strong></strong> are used to bold a text.
  • <i></i> or <em></em> are used to make italic text.
  • <u></u> is used to underline a text (deprecated).
  • <del></del> will strike the text. You can also use <s></s> or <strike></strike> but they're deprecated.

Note: in the source, white spaces don't affect the display of the page.

Insert a link

A link can point to an other site or a file. Remember, an URL starts with http://! The code to insert a link is:

<a href="http://domain.com">link text</a>

If you want to make a link to an email, just put mailto: before your email in the href attribute. Beware of spam.

Insert an image

<img src="your_image.jpg" alt="" />

This is the simpliest form. src is a required attribute; its value must be the path/URL to your image so it must end in .jpg, .gif or .png.

<img src="your_image.jpg" alt="" width="x" height="x" border="x" />

The code above is a bit more complete, with width, height and border attributes. Obviously, x must be a number value and it is in pixels. To avoid an unwanted border on linked pictures, you should put border="0"...

Print This Post Print This Post



Sponsors


Leave a Comment

Works? Doesn't work? Other tips? Please leave a comment! :)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

To post codes, please go to SimpleCode and transform your codes first, so that it will displayed properly. Indeed, < and > need to be converted to &lt; and &gt; :)


Close
E-mail It