Html 跨类样式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14636077/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Span class styling
提问by a.litis
I dont get it, it seems so simple. I want to add a span style to the "Hello" text with a .class
没看懂,好像很简单。我想使用 .class 向“Hello”文本添加跨度样式
http://www.mysecretathens.gr/kulte_test/index.html
http://www.mysecretathens.gr/kulte_test/index.html
Why doesnt this .greeting class work? It only becames 60pixels when I put it like that
为什么这个 .greeting 类不起作用?我这样放的时候才变成60pixels
<span style="font-size:60px;">
Any ideas?
有任何想法吗?
回答by Sajjan Sarkar
You havent closed a CSS class above it. Put a curly brace righ before:
您还没有关闭它上面的 CSS 类。在前面放一个花括号:
::selection{
like so:
像这样:
#container2 {
background-color: #ebebeb;
height: 400px;
background-image: url("white_arrow.png");
background-repeat: no-repeat;
background-position: 50% -28px;
margin: 0 auto;
padding-top: 80px;
text-align: center;
color: #636161;
font-family:'Open Sans', sans-serif;
font-size: 20px;
line-height: 30px;
}
::selection {
color: #fff;
color: rgba(255, 255, 255, .85);
text-shadow: none;
background: #da0225;
}
回答by Chris Bier
The problem is that you didn't close the #container2 css rule.
问题是你没有关闭 #container2 css 规则。
#container2 {
background-color: #ebebeb;
height: 400px;
background-image: url("white_arrow.png");
background-repeat: no-repeat;
background-position: 50% -28px;
margin: 0 auto;
padding-top: 80px;
text-align: center;
color: #636161;
font-family: 'Open Sans', sans-serif;
font-size: 20px;
line-height: 30px;
}
回答by ericosg
Use spaces between your curly braces!
在大括号之间使用空格!
(it rhymed).
(押韵)。
oh and the real issue with your site is #container2 is missing a closing }.
哦,您网站的真正问题是#container2 缺少结尾}。