tik*_*ika 2 html css jquery css3
我可以设置宽度上child-div等于它的parent-div 高度在纯CSS?
到目前为止,我一直在用jQuery做:
$("#child-div").width($("#child-div").parent().height());
Run Code Online (Sandbox Code Playgroud)
这在Pure CSS中是否可以实现?出于某些原因,我需要将它放在Pure CSS中.这是我的HTML:
<div id="parent-div">
<div id="child-div>Hello</div>
</div>
Run Code Online (Sandbox Code Playgroud)
和CSS:
#parent-div{
background:#ddd;
height:80%;
width:30%; position:absolute;
}
#child-div{
position:relative;
background:#333;
color:#FFF;
transform: rotate(270deg);
transform-origin: 0 0 ;
top:100%;
height: /* What ???? */;
}
Run Code Online (Sandbox Code Playgroud)
任何招数?