Computer Science, asked by narebdrmodi7821, 1 year ago

How does applying CSS to an HTML document?

Answers

Answered by Anonymous
2
Use the HTML style attribute for inline styling.

Use the HTML <style> element to define internal CSS.

Use the HTML <link> element to refer to an external CSS file.

Use the HTML <head> element to store <style> and <link> elements.

Use the CSS color property for text colors.

hope \:
helps
Answered by tejasgupta
1

Hi. CSS can be applied to HTML elements in 3 ways:

First Way: Using inline style using the style attribute like:

&lt; h1 style="font-family:Arial; color:red; font-weight:bold" &gt; Heading &lt; /h1 &gt;

Second Way: Using internal style using the &lt; style &gt; tag in the head section like:

&lt; head &gt; &lt; style &gt; h1{font-family:Arial; color:red; font-weight:bold} &lt; /style &gt; &lt; /head &gt;

&lt; body &gt; &lt; h1 &gt; Heading &lt; /h1 &gt; &lt; /body &gt;

Third Way: Using external style sheet. Just do the same body as in the second one and in the head tag, instead of the style tag, use the link tag like:

&lt; link rel="stylesheet" href="location of style sheet" / &gt;

And, in the style sheet, write:

h1{font-family:Arial; color:red; font-weight:bold}

Hope it helps!

Similar questions