2013-03-26 68 views
1

所以我开始使用LESS CSS。现在我有一个不透明的父div:0.8; 我希望孩子有不透明度:1;少css不透明的孩子

所以我创造了这个:

.offerte{ 
    font-family: BrushScriptRegular; 
    font-size: 34px; 
    background-color: black; 
    opacity: 0.80; 

    a:hover { 
    border-bottom: @underlineBorder; 
    opacity: 1; 
    } 
} 

我被告知,这应该覆盖的父母不透明度更低。但这对我不起作用。任何其他解决方案与LESS如何处理?

thx提前!

+1

http://stackoverflow.com/questions/12613191/why-cant-child-elements-override-the-opacity-of-parent-with-a-greater-value TLDR:use'rgba'用于颜色和背景颜色而不是不透明度。 – steveax 2013-03-26 06:09:37

+0

@steveax我知道这是正常CSS的最佳方式。但我真的认为这是可能的与LESS – Kevinvhengst 2013-03-26 06:14:18

+3

不。最终,LESS将向浏览器提供CSS,而不是那里的魔法。 – steveax 2013-03-26 06:15:31

回答

1

他们对你的代码中的一些重大变化,看看,

.offerte { 
    font-family: BrushScriptRegular; 
    font-size: 34px; 
    background-color: black; 
    opacity: 0.8; 
    &:hover { 
    border-bottom: @underlineBorder; 
    opacity: 1; 
    } 
} 

我支持offerte是一类盘旋下来,如果是,那么你应该做这些修改的锚...谢谢...