My background CSS is working fine, but the styling for the .about div is not applying.
Here is my HTML code:
<DOCTYPE! HTML>
<head>
<link rel="stylesheet" type="text/css" href="CSS.css">
</head>
<body>
<div class="About"
<p>Hi</p>
</div>
</body>
This is how I have set up my CSS:
body {
background-image: url("BG.jpg");
background-repeat: repeat-repeat;
}
.About{
font-size:24px;
color:#ffffff;
background-color:#000000;
padding:50px;
margin:50px;
}
The body background works, but the rest of the styles are not being applied as expected.
I have tried a few different approaches like this:
body {
background-image: url("BG.jpg");
background-repeat: repeat-repeat;
}
.About{
font-size:24px;
color:#ffffff;
background-color:#000000;
padding:50px;
margin:50px;
}
p.About{
font-size:24px;
color:#ffffff;
background-color:#000000;
padding:50px;
margin:50px;
}
However, none of these solutions seem to work properly. I also attempted:
body {
background-image: url("BG.jpg");
background-repeat: repeat-repeat;
}
.About{
font-size:24px;
color:#ffffff;
background-color:#000000;
padding:50px;
margin:50px;
}
p.About{
font-size:24px;
color:#ffffff;
background-color:#000000;
padding:50px;
margin:50px;
}
p{
font-size:24px;
color:#ffffff;
background-color:#000000;
padding:50px;
margin:50px;
}
The "p" tag seems to work, but it applies the styles too broadly. I specifically need it to apply to the "About" div only.
I have tested this in both Google Chrome and Internet Explorer, so it doesn't seem to be a browser compatibility issue. Any thoughts on what might be causing the problem?