开发者

Going mad... can't set font colour

<!doctype html public "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html>

<head>
    <link rel="stylesheet" href="css/default.css" type="text/css" /> 
</head>

<body>

<div class="topBar">

</div>

<div class="mainBox">
    erg
</div>

<div class="footer">

    <h3>Community</h3>

</div>
<div class="copyright">
    Copyright &copy; 2011 Scirra.com.  All rights reserved.
</div>

</body>

</html>

With css:

body{
    margin: 0px;
    padding: 0px;
    font-family: Arial, Helvetica, Verdana;
    background-image: url(../images/background.png);
    background-repeat: repeat-x;
}

.topBar{
    position:absolute;
    b开发者_JAVA百科ackground-color: #339900;
    height: 30px;
    border-bottom:2px solid #3FBF00;
    width: 100%;
    z-index:1;
}

.mainBox{
    margin: 0 auto;
    width: 740px;
    border-left: 1px solid #c0c0c0;
    border-right:1px solid #c0c0c0;
    border-bottom: 1px solid #c0c0c0;
    z-index:2;
    position:relative;
    background-color: #ffffff;
    height:400px;
    -moz-border-radius-bottomright: 10px;
    border-bottom-right-radius:  10px;
    -moz-border-radius-bottomleft: 10px;
    border-bottom-left-radius:  10px;
}

.footer{
    position:relative;
    z-index:1;
    top: -15px;
    height:155px;
    padding-top: 15px;
    background-image: url(../images/background-footer.png);
    background-repeat:repeat-x;
    margin-bottom: -15px;
}
.copyright
{
    color: white;
    text-align:center;
    background-color: #000000;
    font-size: 12px;
    padding: 3px;
}
.h3{
    font-size: 16px;
    color: white;
    text-shadow: 0.1em 0.1em 0.2em black;
}

I can't set the font color to white lol, seriously wtf am I doing wrong!


Remove the dot in front of .h3. It should be h3 since it refers to an element, and not a class.


Your CSS for h3 shouldn't have a dot (it isn't a class).

It should be:

h3 {
  font-size: 16px;
  color: white;
  text-shadow: 0.1em 0.1em 0.2em black;
}


remove . from .h3 from style sheet.


there's a typo. simply replace .h3 (class selector) with h3 (element selector).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜