HTML Hints and Tips

Favourite Icon

Add the following to your HTML document <head> section:

<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">

Add favicon.ico to your server's root directory too. See How To Create And Install A favicon.ico which also describes using png2ico to convert a 16x16 pixel png image to ico format. Another option is to use The Gimp.

See also:


HTML 4.01


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"

<html xmlns="" xml:lang="en" lang="en">
    <title>My Page</title>
    <p>My Page</p>

HTTP Redirects

Place a meta tag within the <head> section of your page.

   <meta http-equiv="refresh" content="3; URL=http://somewhere_else/">

CDATA sections

  <attribute><![CDATA[some data]]></attribute>

Specifying Encoding

   <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<!-- or -->
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

Style Sheets

External Style Sheet

   <link type="text/css" rel="stylesheet" href="css/style.css">

Embedded Style Sheet

   <style type="text/css">
     img {border: none}

Escaping HTML/XML

The following characters most commonly need escaping in HTML/XML:

    Character   Entity
    ----------  -------
    "           &quot;
    '           &apos;
    &           &amp;
    <           &lt;
    >           &gt;

See Predefined Entities in XML


-- Frank Dean - 01 Feb 2003

Related Topics: CssTips