Computer Science, asked by queenshane, 9 months ago

What is the difference between text attribute of body tag and color attribute of font tag? This is HTML

Answers

Answered by rakeshchennupati143
12

Explanation:

  • text attribute of body tag refers to the whole part of the code where there is a text, and changes all of it to the specified value given for the attribute text in body tag.
  • except anchor tag, the attribute text in body tag does not effect the color for anchor tag which is having hyper-links.
  • where color attribute of font tag it refers to that tag only, which means the color attribute in font tag changes text which is in that font tag only
  • it does not change for other tags
  • for example consider the code below.

text-in-body-tag:

<html>

     <head>

           <title>text-in-body-tag</title>

     </head>

     <body text="green">

           <p>Text is changed to green</p><br>

           <a href="abc.com">Text color does not change here</a><br>

           <h1>Text color even changes for heading tags</h1>

           <h4>all headings tags's color will be changed</h4>

     </body>

</html>

color-in-font-tag:

<html>

     <head>

           <title>color-in-font-tag</title>

     </head>

     <body>

           <font color="green">Text is changed to green color</font><br>

           <p>But this text does not change</p>

           <h4>The color does not change for headings also</h4>

     </body>

</html>

Note: actually there is a rule for coders out there, where style part of web pages should be written in CSS only, where as content of the web pages should be written in HTML so that when other coder reads your code it will be meaningful.

-----Hope you got what you wanted, if you liked my answer and my example code mark brainliest. In future if you have any doubts about web designing or programming feel free to approach me, i'll try to explain or in most of the cases solve your doubts   :)

Similar questions