text background color code example

Example 1: css background color

body {
  background-color: green;
}

Example 2: text color css

.class {
  color: white;
}

Example 3: css how to change font colr

html {
	color: #f3f3f3;
  	font-family: cursive;
  	font-size: 25px;
}

Example 4: text background color css

body {
	background-color:rgb(130, 50, 29);
}

Example 5: text color css

.YourClass {
  color: #ff0000;
}

Example 6: fill color behid text in html

Put the text in an inline element, such as a <span>.

<h1><span>The Last Will and Testament of Eric Jones</span></h1>
And then apply the background color on the inline element.

h1 {
    text-align: center; 
}
h1 span { 
    background-color: green; 
}
An inline element is as big as its contents is, so that should do it for you.

Tags:

Css Example