How to Add Color to an HTML Web Page

Have you ever ever visited web site the place the colours do not match? Persons are attracted to colours so in case your net web page colours are unattractive it could have an effect on the retention charge of your guests. Web site house owners might fall love with a specific shade they like nevertheless it could flip off their guests. When designing an internet site select colours that fit your services or products then ask for opinions from different folks earlier than you start constructing the precise website.

The way to add shade to an HTML net web page in four other ways

1. Edit HTML

If you wish to change the background shade of an HTML web page merely open it along with your net modifying software program. An expert net designer would both use web site modifying software program resembling Dreamweaver or hand code the HTML in Notepad.


  • Place your cursor after the pinnacle tag and kind physique bg>
  • Select your favourite shade e.g. #003399 will provide you with a darkish blue background.
  • Save the net web page by clicking on file — save.
  • Open your net browser to view the brand new net web page shade
  • Add your HTML web page to the server

2. Use a cascading model sheet(CSS) 

CSS is a well-liked solution to change the design of your net web page with out affecting the HTML. This retains the design separate out of your content material. To vary the background shade of your net web page merely enter the colour you want to use in your model sheet

physique background-color: #00CC66;


  • This may make the background shade of your net web page a lightweight inexperienced.
  • Save the file as model.css
  • Code the CSS file into your net web page between the pinnacle tags on the prime of your web page

hyperlink href=”model.css” rel=”stylesheet” sort=”textual content/css” 

This creates an exterior model sheet which lets you change the colour or any of your design parts by modifying one file. There is no such thing as a have to edit any HTML of your net pages.

three. Create background picture

A background picture permits plenty of design flexibility to create gradients or a combination of colours throughout the picture. The easiest way to realize this with out modifying your HTML is to make use of CSS.

physique background-image: url(pictures/gradient.gif);

background-repeat: no-repeat;

background-position: 280px 440px;

The above CSS code reveals a picture referred to as gradient.gif that does not repeat on the web page. This implies the picture will function a background to the net web page. The background place denotes the place the picture is positioned on the web page.

four. In-line CSS

If you happen to do not want to use a CSS model sheet to vary the background colours you may code the CSS straight into the HTML code.

physique url(pictures/gradient.jpg);background-repeat: no-repeat;background-position: 280px 440px;”

Sidebar: place < firstly of the above code and > on the finish.

You need to use CSS to vary the color list of your font, background of a single line, paragraph, pictures, navigation, hyperlinks and many others.

Whether or not you are designing a brand new web site, redesigning your present one or want to change the colour of a few of your design parts use CSS to rapidly and simply make design modifications.

Recommended Articles

Leave a Reply

Your email address will not be published. Required fields are marked *