Adding CSS to HTML Internally
The first method of adding CSS to HTML is internally. Internal CSS is positioned between the HEAD tag of the HTML document. When using small amounts of CSS this is ideal. It keeps the entire script in a single file, making it more organized.
First we musty create a new HTML file. Below is a simple example of a simple HTML document.
HTML Code:
<HTML>
<head>
<title>Combining HTML and CSS</title>
</head>
<body>
A simple tutorial on how to combine HTML and CSS to make a better script.
</body>
</HTML>
Now that we have a simple HTML document, we add the tags to allow CSS to be added. Below is the beginning and ending tags for adding CSS.
HTML Code:
<style type="text/css">
</style>
Now we adding the style tags into the HTML document head and we get...
<HTML>
HTML Code:
<head>
<title>Combining HTML and CSS</title>
<style type="text/css">
</style>
</head>
<body>
A simple tutorial on how to combine HTML and CSS to make a better script.
</body>
</HTML>
Now you have adding the tags to create an internal CSS script. Later we'll learn how to write CSS and how to style HTML elements.
Bookmarks