Using HTML Tags

Hi there !
Can I specify the color name instead of using hexadecimal code in setting bgcolor tag in HTML?

Hello,
Of course you can specify the color name but giving Hexadecimal code will guarantee wide variety of color choices for each hexadecimal code you have a corresponding color i.e. approximately we can choose among more than 1 crore of colors .
Using name instead of hexadecimal code will give you only limited number of choices for the colors.

@srilayasangannagari
yes you can use name instead of hexadecimal code if you have the knowledge of the name of the color then you can easily use it.

for example:
body bgcolor=“yellow”
OR
body bgcolor="#fff"(will produce white)
OR
you can use rgb() format as well because all color combinations are made from these like:

body bgcolor=rgb(60,120,60)
this will produce dark blue color.
many more no. combinations can be used.

please write the code in <> brackets…:slight_smile:
happy to help you!!!

In HTML ,each color has a hexadecimal code associated with it.
For ex-Hex code for white color is #fffff
For black color is #000000
For green color is #008000
Using this hexa code u can give so many colors to the bg but you can also write directly the name of some colors ex -body bgcolor=“green”

To know the code of any color you visit this url.
http://www.color-hex.com/

Hi,
In HTML there are many ways for specifying the colors, in which Hex code is also one of the ways:

Using this statement you can specify any hex code you want.

Hi
In HTML color can be specified using pre defined color names,RGB,HEX,HSL,RGBA,HSLA values
For example take Tomato,it can be written in different types like
rgb(255,99,71)
#ff6347 (hex)
hsl(9,100%,64%)
rgba(255,99,71,0.5)
hsla(9,100%,64%,0.5)

different ways to specify bgcolor in html:
1)color_name|Specifies the background color with a color name (like “red”)
2)hex_number|Specifies the background color with a hex code (like “#ff0000”)
3)rgb_number|Specifies the background color with an rgb code (like “rgb(255,0,0)”)