Hi, I would like to create an html page in which
background color of the page is black, text color is green,
and tick marks inside the checkboxes have red color.

I am unable to get it right.
Can someone give me a small sample.

  • can you share some code? fmz about 9 years ago

3 answers

Jordan 469

In terms of styling the page(i.e. background color and text) you can add some pretty simple codes to the <body> tag such as this: <body bgcolor="#000000" text="#33CC66">Lorem Ipsum</body> This will make your background black and all your text on the page green. You can choose different shades of green using a Web color chart.

As for the checkbox it's a bit more complicated: Your going to need to use CSS illustrated in this tutorial here. Or you going to have to create two a checkmark in image format via Photoshop, or another editor, and then use a bit of javascript to tell it to add the image when the checkbox is checked.

Answered about 9 years ago by Jordan

Simply use CSS which is the proper way to define styling in web pages. Here is an example:


    <title>Test Page</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
    <h1>Test Page</h1>
    <input type="checkbox" name="check1" />
    <input type="checkbox" name="check2" />
    <input type="text" name="text" value="bar" />


body {
  background: black;
  color: green;

input {
  background: #ddd; 
  color: red;

The checkboxes are a different matter because of the way that browsers implement them. Depending on how badly you want them colored, you may have to replace them with JavaScript or some fancy CSS replacement.

Answered about 9 years ago by kainosnous

Here's what I used on a project recently. http://blogs.digitss.com/javascript/jquery-javascript/jquery-fancy-custom-radio-and-checkbox/

It allows you to specify an image for the 2 states of the checkbox. Works a treat :)

Answered about 9 years ago by Marko Ivanovski