How To Change Background Colour In HTML

When it comes to designing and building a website, many still prefer using the HTML markup language because of its user-friendly coding, styling, animation, editing and much more. Even if you are a beginner, you will easily get acquainted with the coding syntax that is used in HTML as well as CSS, which is a style sheet language that is used extensively in HTML and alongside JavaScript programming language.

These comply with the W3C standards and are used in designing a large number of websites, which are owned by home users, enterprises, businesses, companies, organisations, educational institutions, non-profits, public sectors, etc.

If you have, at some point in time, designed a website using HTML, you will agree with the fact that it lets you perform a wide range of tasks – from designing to editing or modifying web pages in your website.

So, let’s go ahead and learn how to change background colour in HTML without having to use external tools and make your website look more beautiful and visually appealing.

Changing the Background Colour In HTML

You do not require additional software or other premium tools to make necessary visual changes to web pages in your website. Instead, you simply need to make a couple of modifications here and there in the HTML markup language source code to get the desired results in your website.

However, individuals who use website designing tools such as Adobe DreamWeaver, Google Web Designer or any other free or premium software tools, will find a common thing in them and that is the ability to change the background colour in websites in order to make the site look more compelling.

Changing the background colour effectively in one or more web pages of your website is not a difficult task either. So, if you are just a beginner in website designing and want to explore the possibilities of giving a new visual touch to your site, we have the best solutions for you, right here.

Also, if you need assistance, our experts can guide you through changing background colours in your HTML website.

How Do You Change The Colour Of Your Website’s Background In HTML

If your editing your website’s source code via a text editor, all you have to do is simply look for the attribute “<body bgcolor=””>”, which is located in the body of the HTML syntax.

For instance, the syntax would be as follows:

<html>

<head>

<title>Page Title</title>

</head>

<body>

<h>This is a demo on how to change background colour in HTML</h>

<body bgcolor=”#rrggbb”>
</body>

</html>

Thus, from the above syntax, you can easily change the background colour of that particular web page in your website.

As you can see, the above HTML syntax used for changing the background colour of a web page is without CSS. However, if you are using CSS in HTML, then simply follow the method given below.

When using CSS in HTML, look for the “background-color:” in the body element. For example:

<!DOCTYPE html>

<html>

<head>

<title>Page Title</title>

<style>

body {

background-color: #rrggbb

}

</style>

</head>

</html>

This is how you can easily change the background colour of a web page in HTML using CSS.

How To Use Colour Codes Correctly In HTML

There is a rule defined in HTML that allows the use of colours in websites. Thus, there are two methods of applying colours in HTML. These are:

  1. Using colour codes
  2. Using colour names
  1. Using Colour Codes

Hexadecimal colour codes chart represent various colours in alpha-numeric format prefixed with a ‘#’ symbol. Thus, the colour code for their respective colours can be written as follows:

  • #FFFFFF – White
  • #000000 – Black
  • #0000FF – Blue
  • #008000 – Green
  • #FF0000 – Red

These are the main colours used everywhere. There are more colours which can be written in the combination of numbers and letters, prefixed with the ‘#’ symbol in order to determine and apply the colours in HTML and CSS.

  1. Using Colour Names

Not comfortable remembering the colour codes? Do not worry. In HTML, you can input colour names, literally to identify and change colours of background, text, etc. Here, when using the actual names of colours, there is no need to use the ‘#’ symbol. However, one important rule here is that the colour names must be enclosed with double quotation marks (“”) in order to be applied to make the necessary changes.

Get Assistance From Our Experts At Codexoxo

If you have additional questions with regards to changing background colours in HTML, please feel free to contact us on our help desk phone number <enter-phone-number>. Our experts will assist you and provide you the necessary solutions and make your experience in HTML even richer.

Do not wait. Get help today! Call us right away!

Call Now