dfor54
January 14, 2021, 11:42am
1
The body background color is not showing, it worked a few minutes ago but not anymore… can anyone help?
<!doctype html>
<html>
<head>
<style type="text/css">
<!-- modifying body -->
body{background-color:red;}
<!-- modifying h1 heading -->
h1{font-weight:bold;
color:white;
text-decoration:underline;
font-style:italic;
text-align:center;
font-size:100px;
margin:1px;}
<!-- modifying h2 heading -->
h2{font-weight:bold;
color:white;
font-style:italic;
text-align:center;
font-size:40px;
text-decoration:underline;}
<!-- modifying paragraph -->
p{color:white;
font-family:arial;
line-height:130%;
text-align:justify}
<!-- modifying links -->
a:link{color:red; text-decoration:none;}
a:visited{color purple;}
a:hover{background-color:green; color:white; font-weight:bold; text-decoration:underline;}
a:active{backround-color:orange;}
<!-- modifying Unordered table -->
ol{background-color:#8f4579;}
ol{color:white;font-family:arial;font-weight:bold;}
<!-- modifying table -->
table{border: 3px solid green;}
tr{background-color:#8f4579;}
th{border: 2px solid yellow;}
td{border: 2px solid pink;font-style:italic}
</style>
</head>
ILM
January 14, 2021, 11:44am
2
do you have any content in the body?
dfor54
January 14, 2021, 11:47am
3
Yes i do… what happened was , in the tables tab i wrote color : white reloaded the page and background changed. I undid the changes and still the same.
ILM
January 14, 2021, 11:50am
4
maybe you need to reload again?
Hi @dfor54 !
I copied your css code and threw it into codepen and got this result.
But I am not really sure what you mean by tables tab.
dfor54
January 14, 2021, 11:52am
6
Sorry i meant in this line table{border: 3px solid green;}
I took it out and the backround remained white.
dfor54
January 14, 2021, 11:53am
7
I’ve tried. still the same result.
1 Like
I can only seem to get it to work in a seperate css section.
So you might want to try that.
Also this is the proper <!DOCTYPE html>
not this <!doctype html>
2 Likes
dfor54
January 14, 2021, 12:22pm
9
thanks so much. I found it what the problem was but have no idea why. it was the comments.
ILM
January 14, 2021, 12:51pm
11
you are right, to write comments in css you need to use /*
to start and */
to end the comment
2 Likes
dfor54
January 14, 2021, 1:12pm
12
Thanks i did not know that. I’m new to HTML.
system
Closed
July 16, 2021, 1:12am
13
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.