Embedded Styles
CSS styles can be placed all together in the head section of an html page rather than within each tag. To do so, simply place your css within a section defined by a <style> tag like this:
<html>
<head>
<title>Sample Page</title>
<style type="text/css">
p{font-family: Arial; color: red;}
</style>
</head>
<body>
<p>Hello World!</p>
</body>
</html>
The "text/css" attribute simply tells the browser that the style information will be a text based version of css instructions.
Note the use of the curly brackets in the CSS rule definitions. In the example below, all "p" tags would have text that is red and be of font size 1.5 em.
<html>
<head>
<title>Sample Page</title>
<style type="text/css">
p{font-family: Arial; color: red;}
</style>
</head>
<body>
<p>Hello World!</p>
</body>
</html>
The "text/css" attribute simply tells the browser that the style information will be a text based version of css instructions.
Note the use of the curly brackets in the CSS rule definitions. In the example below, all "p" tags would have text that is red and be of font size 1.5 em.