风格中可以有风格吗?
例如,像这样:
#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.
不,只是这样:
#content
{
text-align: center;
border-style:solid;
border-width:10px;
border-color: #121212;
}
#content h1
{
font-family: arial;
}
Run Code Online (Sandbox Code Playgroud)
这就是你需要的
#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)