HTML Code for Yellow

What is HTML Code for Yellow?

HTML code for yellow is the code used to display the color yellow in a web page. In HTML, colors can be specified using a variety of methods, including color names, hexadecimal color codes, RGB values, and HSL values.

Using Color Names

One of the simplest ways to specify the color yellow in HTML is by using the color name 'yellow' within the style attribute of an HTML element. For example, <p style="color: yellow;">This text is yellow.</p>

Using Hexadecimal Color Codes

Yellow can also be represented using its hexadecimal color code, which is #FFFF00. This code can be used within the style attribute like this: <p style="color: #FFFF00;">This text is also yellow.</p>

Using RGB Values

RGB values can also be used to define the color yellow. The RGB values for yellow are (255, 255, 0). This can be applied using the following code: <p style="color: rgb(255, 255, 0);">This text is yellow as well.</p>

Using HSL Values

HSL (Hue, Saturation, Lightness) is another way to specify colors in CSS. The HSL representation of yellow is hsl(60, 100%, 50%). This can be used within the style attribute like so: <p style="color: hsl(60, 100%, 50%);">This text is yellow in HSL.</p>

Example Code

<p style="color: yellow;">This text is yellow.</p>

Go from files to website in seconds.

Start a free trial for 7 days — no credit card required

Get Started for Free