>  기사  >  웹 프론트엔드  >  用尽量少的DIV 标签配合样式如何实现下面2图效果(不考虑兼容性,不允许使用图片或背景图)?_html/css_WEB-ITnose

用尽量少的DIV 标签配合样式如何实现下面2图效果(不考虑兼容性,不允许使用图片或背景图)?_html/css_WEB-ITnose

WBOY
WBOY원래의
2016-06-24 11:52:091132검색

请用尽量少的DIV 标签配合样式分别去实现出下面2图效果,不考虑兼容性,不允许使用图片或背景图的方式去实现,可以使用背景颜色。(图片在下面)


回复讨论(解决方案)

图片1:



图片2:




div{background-color:#000;transform:rotate(-45deg);} 第一个

<div style="overflow:hidden;_height:1%;">	<div class="a"></div>	<div class="a b"></div></div><div style="overflow:hidden;">	<div class="aa"></div>	<div class="aa bb"></div></div><div class="aaa"></div><div style="overflow:hidden;">	<div class="aa"></div>	<div class="aa bb"></div></div><div style="overflow:hidden;_height:1%;">	<div class="a"></div>	<div class="a b"></div></div>

.a{ width:10px; height:10px; background-color:#000; float:left;}.b{ margin-left:70px;}.aa{ width:20px; height:20px; background:#000; float:left; margin-left:10px;}.bb{ margin-left:30px;}.aaa{ margin-left:30px; height:30px; width:30px; background:#000;}
 第二种

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.