How to set the color of label label in html

青灯夜游
Release: 2023-01-06 11:14:31
Original
16509 people have browsed it

htmlHow to set the label color: 1. Use the style attribute of the label tag and add the "color: color value;" style; 2. Use the style attribute of the label tag and add "background-color: color value;" "style.

How to set the color of label label in html

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

Method 1: Use the style attribute to add the "color: color value;" style

<form>
  <label for="male">Male</label>
  <input type="radio" name="sex" id="male" />
  <br />
  <label for="female" style="color: red;">Female</label>
  <input type="radio" name="sex" id="female" />
</form>
Copy after login

Rendering:

How to set the color of label label in html

##Method 2: Use the style attribute to add the "background-color: color value;" style

<form>
  <label for="male">Male</label>
  <input type="radio" name="sex" id="male" />
  <br />
  <label for="female" style="background-color: red;">Female</label>
  <input type="radio" name="sex" id="female" />
</form>
Copy after login
Rendering:

How to set the color of label label in html

Recommended tutorials:

html video tutorial, css video tutorial

The above is the detailed content of How to set the color of label label in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!