What is the difference between HTML and CSS?

Not really the same at all. Here are two examples. First HTML…

<html>
<head>
  <title>HTML Example</title>
</head>
<body>
  <h1>Hello, from HTML!</h1>
  <p>This is a paragraph. <span>Here's a span</span> inside the paragraph.</p>
</body>
</html>

And some CSS…

body {
  width: 700px;
  background: lightblue;
}
h1 {
  color: darkgray;
}
p span {
  background: yellow;
  font-family: cursive;
}

Now, you can put CSS inline with HTML…

<span style="background: yellow; font-family: cursive;"> ... </span>
Spread the love