Tutorial How To Put Background Color In Text Using Html Coding

Prasoon Arora

Yellow Belt
We always want to highlight text in our website, for some important information. To keep the text highlighted with the background color is one of the option.

You do not need to be expert in html, neither you need to learn something. Just have a look on the below mentioned steps and you would be able to highlight your text with the background color.

Syntax : <FONT style="BACKGROUND-COLOR: red"> Text</FONT>

1. To put a particular text highlighted use the below mentioned coding :

<HTML>
<HEAD>
</HEAD>
<BODY>

<P>My name

<FONT style="BACKGROUND-COLOR: red"> "Prasoon"</FONT>

would be highlighted in red background
</P>

</BODY>
</HTML>

See the result to be displayed :


onlyname.PNG


2. To put the complete sentence in background color use the coding as mentioned below :

<HTML>
<BODY>

<P>

<FONT style="BACKGROUND-COLOR: yellow"> This text including my name Prasoon would be in yellow color.</FONT>

</P>

</BODY>
</HTML>

See the result to be displayed :


fulltext.PNG




Note : Using <HEAD></HEAD> depends on you, need to be written as <head> tags denote the heading in the page.
 
Last edited:

Zirkon Kalti

Yellow Belt
If you need any help on HTML code, you simply search for it on Google for example background color + code and the search result will returns website that provide the tutorial and the sample code. One great site where you can find HTML and CSS codes is W3 Schools.
 

SirJoe

Yellow Belt
If you need any help on HTML code, you simply search for it on Google for example background color + code and the search result will returns website that provide the tutorial and the sample code. One great site where you can find HTML and CSS codes is W3 Schools.
w3schools is a great place to remove any doubt that you might have, but I find that you have to have some knowledge in programming to use it. It does have some great info though.
 

Pooja Sharma

Yellow Belt
I always wish to find options to put background color to my text that needs to be highlighted in my website.I just referred to the above codings and find it simple to use as if there is no need to learn any specific language. W3S schools website is really a great place to learn any language from HTML, PHP to css. W3Sschool website have even provided the coding explanation and description chapter wise that would be helping a lot of people who really wish to put their efforts in building website using coding.
 

coolyfrost

Yellow Belt
Thanks for the guide OP! I am new to HTML so I'm still learning new things and that is definitely a cool trick to know. Does anyone else know about other HTML tricks that I can try out? Thanks!
 

Pooja Sharma

Yellow Belt
@Prasoon Arora :
Can you please let us know if there is a way that text can moved from up to doun or vice versa.As I have noticed in most of the website text goes from top to bottom or bottom to top to show their news feeds or current updates happening in the website. This type of animated text are really helpful to attract visitors and I wish to know how it can be done.
 

Prasoon Arora

Yellow Belt
I really appreciate your efforts made to learn html. Learning html do not require much troubleshooting steps. As html, is preferred more in compared to any of the stuffs. If you are stuck anywhere, you may search and can find the solution easily.

Being a programmer, I respect newbies and help them always.

@Pooja Sharma :
@coolyfrost :

You may refer to my thread related to move your text from top to bottom for another trick. Give it a try with your own skills, and I will make sure I can provide as much tricks that I am aware of.
 

coolyfrost

Yellow Belt
I really appreciate your efforts made to learn html. Learning html do not require much troubleshooting steps. As html, is preferred more in compared to any of the stuffs. If you are stuck anywhere, you may search and can find the solution easily.

Being a programmer, I respect newbies and help them always.

@Pooja Sharma :
@coolyfrost :

You may refer to my thread related to move your text from top to bottom for another trick. Give it a try with your own skills, and I will make sure I can provide as much tricks that I am aware of.
Alright, thanks! I'm trying to get into several programming languages at the moment and I think that HTML will be a good start since it supposedly is extremely simple to get into. Of course it will always take several years to master a programming language, but I'm confident that with enough time everything is possible :p .
 
Top