javascript - Inherit colour and then make it darker/brighter -
i have 2 div's 1 .father , other 1 .child - follows:
<div class="father"> <p></p> </div> <div class="child"> <p></p> </div> as can see, child not inside father (sorry if seems doggy, example blinked me). trying do; when give .father background colour lets "background-color: #000". want child inherit colour black make brighter/darker...
i have tried following:
.child { background-color: -20%; } i don't know if real way, guess it's stupid - need share did. have tried using css transparency applied whole div... if div has text inside it?
so example, wrap div .child div , give div black background, apply transparency div .child - apply transparency text well!
if have added around how can make span inherit colour of div inside it? , inherit size well.
i'm afraid cannot in pure css. unless of course work rgba colors make transparent.
there function in sass (and less) allows darken/lighten colors. take @ these function's reference here. more information sass/scss: http://sass-lang.com/
Comments
Post a Comment