css - Element style according to other class with LESS -
i have part of less , html markup:
<div class="block"> <div class="post-image"></div> <p></p> </div> and
.post-image { display: inline-block; width: 35%; height: 80px; &.photo { width: 100%; height: 180px; } } p { width: 64%; display: inline-block; when (isstring .post-image.photo) { width: 100%; } i know wrong setup wanna know, there possible append paragraph (p) style photo width or class in less? thx help.
this not technically less thing, purely css construct situation (which, of course, less can build). here need less , resulting css snippet of html (the .post-image code have):
less
p { width: 64%; display: inline-block; .post-image.photo + & { width: 100%; } } css
p { width: 64%; display: inline-block; } .post-image.photo + p { width: 100%; } the second override first when .photo class added .post-image.
Comments
Post a Comment