How to paste new css/html code into your website.

Posted: Mon 11 May, 2009

It is possible to just paste the CSS code into the <head></head> tags of your webpage, this is ok if your website consists of only one page. Creating a Style Sheet is a better solution as it gives you complete control over the look of every page within your website.


Step One


Create a file called stylesheet.css. You can put this file in the same directory as your index.html or in another directory. Once the file is created, open it.


Step Two


Make sure the stylesheet is completely blank and then paste the css code into the style sheet. Ensure that you have removed the tags:<style type="text/css"></style> as they are not required within a style sheet.


Example:

p{

color:#666666;

font-size: 11px;

}


Save the style sheet.


Step Three


In your index.html file (or any other page that you wish to include styles) locate the head section at the top. It should look something like this...


Example:

<!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">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />



<title>Your Website Title</title>

</head>

Above the <title></title> tags insert the following:


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

Now the Head of your page should look like this...


Example:

<!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">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

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

<title>Your Website Title</title>

</head>

Now your website has a style sheet! Any changes made to this new style sheet will affect all pages linked to it. Now, let`s paste the html code into your webpage...


Step Four: Pasting html code


Find the <body></body> tags within your webpage.


Example:
<body>

</body>

... and insert the html code where you would like it to appear on your webpage. As this examples page is blank the new code may look like this...


Example:

<body>


<p>Paragraph 1</p>

<p>Paragraph 2</p>

<p>Paragraph 3</p>


</body>

I hope this has helped.



Dont forget, you dont have to use a style sheet. CSS can be pasted into the head section of your webpage within the <style type="text/css"></style>
tags.





Terms & Conditions | Site Map | Contact | asterix templateWebsite Template Builder | Free Templates | Free Wallpapers

W3c compliant (XHTML)    W3c Compliant (CSS)

Web Design    Personal Blogs - Blog Rankings

Css is one of the main ingredients for a User-friendly, Accessible website.
A good web designer should make every effort not to discriminate against those with disabilities.

Thank-you for visiting Free CSS Menus today: Wednesday 22nd of February 2017

free css design inspiration
What is CSS?