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

WBOY
Release: 2016-06-24 11:52:09
Original
1139 people have browsed it

请用尽量少的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>
Copy after login

.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;}
Copy after login
 第二种

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!