CSS and HTML 5 – Basic CSS Syntax

The basic syntax of CSS is to Assign Values to Properties for Selectors. In CSS “selectors” are synonymous with tags. So the h1 Selector refers to the h1 HTML Tag.

CSSsyntax.html

<html>
<head>

<style>
body {
  background-color: orange;
}

h1 {
  color: white;
  text-align: center;
}

h2 {
  background-color: yellow;
}

h3 {
  border:5px solid blue;
}

p {
  font-family: arial;
  font-size: 40px;
}
</style>

</head>

<body>

<h1>This is H1</h1>
<h2>This is H2</h2>
<h3>This is H3</h3>
<p>This is P</p>

</body>
</html>

Be the first to comment

Leave a Reply