Monday, October 28, 2024

HTML Colors

 

HTML Colors


HTML Background-color


background colour 

<h1 style="background-color:DodgerBlue;">Hello World</h1>

<p style="background-color:Tomato;">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
</p>



Text Color 


<h3 style="color:Tomato;">Hello World</h3>

<p style="color:DodgerBlue;">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>

<p style="color:MediumSeaGreen;">Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>



The <bgcolor> is the attribute to set the background color of an HTML element. This attribute is used with the following tags:

  • <body>
  • <table>
  • <marquee>
  • <td>
  • <th>
  • <tr>

Deprecated <bgcolor> Usage Examples

1. <body> tag

Sets the background color of the entire page.

html

<body bgcolor="lightblue"> <h1>This is a light blue background</h1> </body>

2. <table> tag

Sets the background color of the table.

html
<table bgcolor="lightgray" border="1"> <tr> <td>Row 1, Cell 1</td> <td>Row 1, Cell 2</td> </tr> </table>

3. <marquee> tag

Sets the background color for the scrolling text.

html
<marquee bgcolor="yellow">This is scrolling text with a yellow background!</marquee>

4. <td> tag

Sets the background color for a table cell.

html

<table border="1"> <tr> <td bgcolor="lightgreen">Cell 1 with green background</td> <td>Cell 2</td> </tr> </table>

5. <th> tag

Sets the background color for a table header cell.

html
<table border="1"> <tr> <th bgcolor="pink">Header 1</th> <th>Header 2</th> </tr> <tr> <td>Row 1, Cell 1</td> <td>Row 1, Cell 2</td> </tr> </table>

6. <tr> tag

Sets the background color for an entire row in a table.

html

<table border="1"> <tr bgcolor="lightyellow"> <td>Row 1, Cell 1</td> <td>Row 1, Cell 2</td> </tr> <tr> <td>Row 2, Cell 1</td> <td>Row 2, Cell 2</td> </tr> </table>

No comments:

Post a Comment

INFORMATION

 VINAYAL SHEET 35 PER SHEET WITH CUTTNG PH-2 PANCHKULA PIXAL  PASSPORT PHOTO SIZE 3.5 X 4.5 ==110 STAMP  SIZE     1.06/ 0.87