Layout (CSS) : Cascading Style Sheets
Layout (CSS) : Cascading Style Sheets
Layout (CSS)
What is CSS?
A CSS comment begins with "/*", and ends with "*/", like this:
/*This is a comment*/
p
{
text-align:center;
/*This is another comment*/
color:black;
font-family:arial;
}
CSS is the better half of HTML. And in coding,
there is no equality of status: HTML takes
care of the rough stuff (the structure), while
CSS gives it a nice touch (layout).
One of the smart features of CSS is the
possibility to manage your layout centrally.
Instead of using the style attribute in each
tag, you can tell the browser once how it
must layout all the text on the page:
<html>
<head>
<title>My first CSS page</title>
<style type="text/css">
h1 {font-size: 30px; font-family: arial;}
h2 {font-size: 15px; font-family: courier;}
p {font-size: 8px; font-family: "times new roman";}
</style>
</head>
<body>
<h1>My first CSS page</h1>
<h2>Welcome to my first CSS page</h2>
<p>Here you can see how CSS works </p>
</body>
</html>
What else can I do with CSS?
Result
I Love CSS
With the property float an element can either be floated
to the right or to the left.