To use CSS with HTML, you can either embed the CSS code in the HTML file using the <style> element or create a separate CSS file and link to it using the <link> element in the HTML file.Here is an example of using an embedded <style> element in HTML:
In this example, the CSS code is embedded within the <style> element in the <head> section of the HTML file. The CSS code sets the background color of the <body> element to light blue and the color of the <h1> element to red.
Alternatively, you can create a separate CSS file named style.css, for example, and link to it in the HTML file using the following code:
In this example, the CSS code is stored in the style.css file, which is linked to the HTML file using the <link> element in the <head> section of the HTML file.