Separating Elements and Styles

Inline Styling:

  • <p align="center" style="font-style: italic">I see Jane.</p>
  • <p style="text-align: center; font-style: italic">I see Jane.</p>

Styling with a Stylesheet in the <head> Element:

<html>
<head>
<style type="text/css">
p {
    text-align: center;
    font-style: italic;
}
</style>

</head>
<body>
<p>I see Jane. </p>
</body>
</html>


Styling with an External Stylesheet:

<html>
<head>
<link rel type="stylesheet" type="text/css" href="stylesheet.css" />
</head>
<body>
<p>I see Jane. </p>
</body>
</html>

View Page


Definitions:

  • Cascading Stylesheets (CSS): A markup language for rendering content style.
  • Property: A styling feature of an element in CSS
  • Value: A setting for a property in CSS

Return to Top