Friday, 22 April 2011

Setting up the HTML

Now that we have decided how we are going to integrate the styling into the HTML file we have to set-up the HTML file to pull in the style sheet.

We have 2 main methods to call the style sheet:

   1. Link href
   2. @import

Method 1: link href
Click for (X)HTML Code
Open or Close Box
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN" lang="EN" dir="ltr">
<head>
<title>External CSS Stylesheet</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="styles.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
</html>

Method 2: @import
Click for (X)HTML Code
Open or Close Box
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN" lang="EN" dir="ltr">
<head>
<title>External CSS Stylesheet</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
@import url("styles.css");
</style>
</head>
<body>
</html>

Website Design | Website Design Company | Web Development
Get a beautiful website design. Studio Web is a results oriented web design & online marketing firm serving companies worldwide.
Sponsored Link

No comments:

Post a Comment