+ 1
Hello can someone explain how to combine html,css in one document and run
3 Answers
0
CSS can be added to HTML documents in 3 ways:
Inline - by using the style attribute inside HTML elements
Internal - by using a <style> element in the <head> section
External - by using a <link> element to link to an external CSS file
Example of inline--
<h1Â style="color:blue;">A Blue Heading</h1>
Example of internal--
<html>
<head>
<style>
body {background-color: powderblue;}
h1Â Â Â {color:Â blue;}
p    {color: red;}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Example of external --
add a link to the <head> section of each HTML page like this:
<html>
<head>
  <link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>