样式中的CSS样式?

Hen*_*-95 5 css

风格中可以有风格吗?

例如,像这样:

#content
{
text-align: center;
border-style:solid;
border-width:10px;
border-color: #121212;

     h1
     {
       font-family: arial;
     }

}
Run Code Online (Sandbox Code Playgroud)

我实际上要做的是只在内容div中使用标题字体作为arial.

Mār*_*ovs 9

不,只是这样:

#content
{
text-align: center;
border-style:solid;
border-width:10px;
border-color: #121212;
}


#content h1
{
       font-family: arial;
}
Run Code Online (Sandbox Code Playgroud)


Mou*_*nad 6

这就是你需要的

#content
{
    text-align: center;
    border-style:solid;
    border-width:10px;
    border-color: #121212;
}

#content #header
{
    font-family: arial;
}
Run Code Online (Sandbox Code Playgroud)

更新:由于您的问题已更改

#content h1
{
    font-family: arial;
}
Run Code Online (Sandbox Code Playgroud)