如何更改字体颜色?

时间:2017-11-29 13:41:12

标签: html css

这是我显示树结构的代码。我想以黑色显示它。但它采取白色。不,我提到白色。在身体我提到黑色,即使它是白色的。我怎样才能改变这一点。

我的代码是,  我在这里没有提到完整的代码,我只提到了所需的代码。

<div class="pagecontainer">';
echo "<ul id='treeMenu'>";                      
echo "<li class='contentContainerMain'>";
echo "<ul style='display: none'>";
echo "<li class='contentContainer'>";
echo "</li>";
echo "<ul >";
echo "<li class='contentContainer'>";
echo "</li>";   
echo "</ul>";
echo "</ul>";
echo "</li>";       
echo "</ul> 
echo "</div>";<!-- END TREE MENU -->";

css是,

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    font-size: 100%;
    vertical-align: baseline;
    background: transparent;
}
body {
    line-height: 1;
        color: black;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}

/* remember to define focus styles! */
:focus {
    outline: 0;
}

/* remember to highlight inserts somehow! */
ins {
    text-decoration: none;
}
del {
    text-decoration: line-through;
}

/* tables still need 'cellspacing="0"' in the markup */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

a.mm {
    position:fixed;
    bottom:10px;
    right:10px;
    background:url(MediaMilan-White.png) left top no-repeat;
    width:30px;
    height:30px;
    display:block;
}

/* ---- END CSS RESET --- */

body 
{
    font-family:Arial;
    font-size:16px;
    line-height: 23px;

}

.pagecontainer
{
    padding:5px;
    position:absolute;
    top:0;
    left:0;
        color: #00ff00;
}

img.bg {

        min-height: 100%;
        min-width: 1024px;


        width: 100%;
        height: auto;


        position: fixed;
        top: 0;
        left: 0;
        z-index:-1;
}

@media screen and (max-width: 1024px) { /* Specific to this particular image */
        img.bg {
                left: 50%;
                margin-left: -512px;   /* 50% */
        }
}

.ie-six {
    display:none;
}


#treeMenu li {

    padding:0 0 10px 10px;

}

#treeMenu li {
    cursor: default;
}

#treeMenu li.contentContainer  {
    background:url('right.png ') no-repeat -3px 6px;

    cursor: pointer;
}

#treeMenu li.contentViewing {
        background:url('down.png ') no-repeat -4px 6px;

        cursor: pointer;
}
#treeMenu li.contentContainerMain  {
    background:url('right.png ') no-repeat -3px 6px;

    cursor: pointer;
}

#treeMenu li.contentViewingMain {
        background:url('down.png ') no-repeat -4px 6px;

        cursor: pointer;
}
.contentContainer ul, .contentViewing ul, .contentContainerMain ul, .contentViewingMain ul {

    margin:15px 0 0 10px;

}

1 个答案:

答案 0 :(得分:-1)

尝试使用此css,

    .pagecontainer #treeMenu{
    color:#000
    }

或者您只需签入html <li><font color="#000">This is some text!</font></li>

即可

如果您的文字位于<p><h1>(h2,h3等等)内,那么您可以按如下方式使用目标css,

p{color:#000;}

h1{color:#000;}

虽然提出了您的问题,但我不知道您的文字会在哪里找到。如果您在正确的位置添加一些文字,则会更有帮助