5
经过一些挖掘后,我发现this作为我需要有圆角的桌子的最佳反应。圆角桌与LESS
导致我到下面的CSS代码片段:
.greytable tr:first-child th:first-child {
-moz-border-radius-topleft: 5px;
-webkit-border-top-left-radius: 5px;
border-top-left-radius: 5px;
}
.greytable tr:first-child th:last-child {
-moz-border-radius-topright: 5px;
-webkit-border-top-right-radius: 5px;
border-top-right-radius: 5px;
}
.greytable tr:last-child td:first-child {
-moz-border-radius-bottomleft: 5px;
-webkit-border-bottom-left-radius: 5px;
border-bottom-left-radius: 5px;
}
.greytable tr:last-child td:last-child {
-moz-border-radius-bottomright: 5px;
-webkit-border-bottom-right-radius: 5px;
border-bottom-right-radius: 5px;
}
现在我想知道我怎么能简化所有这些用量少。我尝试以下更少的代码:
.border-radius (@v, @h, @radius: 5px) {
[email protected]@h: @radius;
[email protected]@h: @radius;
[email protected]@h: @radius;
}
,然后调用它(的左上角):
.greytable tr:first-child th:first-child {
.border-radius('top', 'left')
}
但它不工作(就少片段的第二行错误) 。
在此先感谢!
我修正了我的硬编码错误,你可以相应编辑。非常感谢! – janosrusiczki 2012-03-02 09:17:06
至少在WinLess中仍然无法工作。 – janosrusiczki 2012-03-02 09:26:02
是的,我被困住了,现在太疲倦了。我明天会检查一下,看看你是怎么做出来的。 – 2012-03-02 09:53:07