Ask coding questions

← Back to all posts
How to do programming HTML so that when the site is made
Agzamikail (2)

How to do programming HTML so that when the site is made, part of its background behind the text is of a certain color and how to change the color of the letters ?

Answered by Coder100 (16760) [earned 5 cycles]
View Answer
Comments
hotnewtop
RYANTADIPARTHI (6006)

Solution

for the background part, you can use this.

<style>
    body {
        background-color: red;
    }
</style>

for the changing color of text, try this.

<h1 style="color: blue">This is blue</h1>

like that.
That should work

Agzamikail (2)

And you can do only on a certain part of the site was of the same color and the other half of the site in a different color ? @RYANTADIPARTHI

Coder100 (16760)
<div style="background: green; color: white;">
am green
</div>

<div style="background: red; color: white;">
am red
</div>

@Agzamikail