html - Place a div along border edge of div -
in web application, wanted place small div along border edge of div this:
this code:
<div style="border:1px solid black; height:1em; width:10em;"> <div style="border:1px solid black; display:inline-block; height:10em; width:10em;"> along edge </div> </div>
how can done?
following way can it. make main div position:relative
, along edge div position:absolute
main div. , give top
, right
sub div.
.main{ border:2px solid; position:relative; width:400px; height:150px; top:50px; } .sub{ border:1px solid; position:absolute; right:10px; top:-10px; z-index:99; background-color: #fff; }
<div class="main"> main div <div class="sub"> along edge </div> </div>
hope helps.
Comments
Post a Comment