background color on text css code example

Example 1: css background color

body {
  background-color: green;
}

Example 2: text color css

.class {
  color: white;
}

Example 3: text background color css

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

Example 4: fill color behid text in html

Option 1
display: table;

no parent required
h1 {
    display: table; /* keep the background color wrapped tight */
    margin: 0px auto 0px auto; /* keep the table centered */
    padding:5px;font-size:20px;background-color:green;color:#ffffff;
}

The Last Will and Testament of Eric Jones

Tags: