html - How to set a shadow on a two panels page, regardless of its height? -
i have found answer, not sure best approach problem. page has 2 panels: 1 sidebar , 1 content view. want have shadow on sidebar if content view producing it:
the problem sidebar menu buttons, icons, etc. if try set (inset) shadow there:
.sidebar { box-shadow: inset -7px 0 9px -7px rgba(0,0,0,0.7); }
i get:
so, have buttons, hide shadow. if other way content view produces it:
.content { box-shadow: -7px 0 9px -7px rgba(0,0,0,0.7); }
i shadow along content, if content "shorter" total height of screen, shadow disappears. similar previous case.
my final approach set manual height content view or javascript, adapt viewport height. not sure best way it. know if there more css way it, without having set things manually or getting shadows cut.
edit
while creating fiddle better understanding problem realized had background-color
on buttons. since have hover
, transition
on button, still hides shadow. check out: http://jsfiddle.net/h3cp59qd/
check out: http://jsfiddle.net/h3cp59qd/3/
use position:absolute
both sidebar
, content
:
body, html { background: #d8d8d8; height: 100%; margin: 0; padding: 0; } #app { width: 100%; height: 100%; position: relative; } #sidebar { width: 20%; z-index: 1; position: absolute; top: 0; bottom: 0; background: #c8c8c8; } #sidebar ul { list-style-type: none; margin: 0; padding: 0; } #sidebar ul li { padding-left: 20px; height: 60px; text-transform: uppercase; color: white; font-weight: 900; font-size: 12pt; line-height: 60px; vertical-align: middle; } #sidebar ul li:hover { background: #c0c0c0; color: #eee; } #content { width: 80%; position: absolute; z-index: 100; left: 20%; top: 0; bottom: 0; padding: 0 50px; box-shadow: -7px 0 9px -7px rgba(0,0,0,0.7); }
Comments
Post a Comment