[英]Turning a Link Into a Little Circle With CSS
I have the following html code:我有以下 html 代码:
<ul class="smenu">
<li class="smenuitem"><a href="http://ux.stackexchange.com/"></a></li>
<li class="smenuitem"><a href="http://area51.stackexchange.com/"></a></li>
<li class="smenuitem"><a href="http://www.webmasters.stackexchange.com/"></a></li>
</ul>
I'm trying to get the links to look like round circles with a width of 25px and a height of 25px, so I applied the following css:我试图让链接看起来像宽度为 25px、高度为 25px 的圆形,所以我应用了以下 css:
li.smenuitem a, li.smenuitem a:link:hover, li.smenuitem a:visited, li.smenuitem a:visited:hover, {
display: block;
width: 25px;
height: 25px;
border-radius: 25px;
background-color: #0000ff;
}
However, the links did not appear at all.但是,链接根本没有出现。 They were not 25px by 25px, and they did not have rounded corners (they weren't in a circular shape).
它们不是 25px x 25px,也没有圆角(它们不是圆形)。 Can anyone tell me what I'm doing wrong?
谁能告诉我我做错了什么?
You have a misplaced comma (see at the very end of the selector list):您有一个放错位置的逗号(请参阅选择器列表的最后):
li.smenuitem a, li.smenuitem a:link:hover, li.smenuitem a:visited, li.smenuitem a:visited:hover, {
Versus:相对:
li.smenuitem a, li.smenuitem a:link:hover, li.smenuitem a:visited, li.smenuitem a:visited:hover {
display: block;
width: 25px;
height: 25px;
border-radius: 25px;
background-color: #0000ff;
}
Remove the last comma in the selector after a:visited:hover, I think thats whats scrwing it up在 a:visited:hover 之后删除选择器中的最后一个逗号,我想这就是搞砸了
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.