Inline CSS applies styles directly to HTML elements using the style
attribute. Here, the <h1>
text is blue and the <p>
text is red.
<h1 style=”color:blue;”>A Blue Heading</h1> <p style=”color:red;”>A red paragraph.</p> |
Internal CSS defines styles for an HTML document within a <style>
element in the <head>
. In this example, <h1>
text is blue, <p>
text is red, and the page background is “powderblue”.
<!DOCTYPE html> |