分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > IT知识

WEB前端面试题 分别使用2个、3个、5个DIV画出一个大的红十字

发布时间:2023-09-06 01:43责任编辑:沈小雨关键词:前端面试题
[html] view plain copy
 
  1. <!DOCTYPE html>  
  2. <!--两个DIV-->  
  3. <html>  
  4. <body>  
  5. <div style="width:100%;height:200px;margin-top:500px;location:center;border:none;background-color:red;position:absolute">  
  6. </div>  
  7. <div style="width:16%;height:1000px;margin-left:42%;margin-right:42%;margin-top:0px;border:none;background-color:red;style=clear:both;position:absolute">  
  8. </div>  
  9. </body>  
  10. </html>  
[html] view plain copy
 
  1. <!DOCTYPE html>  
  2. <!--三个DIV-->  
  3. <html>  
  4. <body>  
  5. <div style="width:100%;height:100px;margin-top:500px;location:center;border:none;background-color:red;position:absolute"></div>  
  6. <div style="width:100%;height:100px;margin-top:400px;location:center;border:none;background-color:red;position:absolute"></div>  
  7. <div style="width:16%;height:1000px;margin-left:42%;margin-right:42%;margin-top:0px;border:none;background-color:red;position:absolute">  
  8. </div>  
  9. </body>  
  10. </html>  
[html] view plain copy
 
  1. <!DOCTYPE html>  
  2. <!--五个DIV-->  
  3. <html>  
  4. <body>  
  5. <div style="width:100%;height:65px;margin-top:500px;location:center;border:none;background-color:red;position:absolute"></div>  
  6. <div style="width:100%;height:65px;margin-top:435px;location:center;border:none;background-color:red;position:absolute"></div>  
  7. <div style="width:100%;height:65px;margin-top:370px;location:center;border:none;background-color:red;position:absolute"></div>  
  8. <div style="width:8%;height:1000px;margin-left:42%;margin-right:50%;margin-top:0px;border:none;background-color:red;position:absolute"></div>  
  9. <div style="width:8%;height:1000px;margin-left:49%;margin-right:42%;margin-top:0px;border:none;background-color:red;position:absolute"></div>  
  10. </body>  
  11. </html>  

法二:

具体思想为:两个,用DIV创建一个矩形,然后复制一个,以中心点旋转90度,两个合并;三个,用DIV创建一个矩形,然后复制一个,以中心点旋转90度,两个合并,然后在外面包一个空的DIV盒子;五个,红十字标志由五个正方形组成,代表五大洲,画一个正方形,然后复制成五个,再将五个正方形摆放好位置,组成红十字形状,圈选五个正方形之后,选择焊接选项,再填充红色(C:0,M:100,Y:100,K:0),去除边框颜色即可。

[html] view plain copy
 
  1. <!DOCTYPE html>  
  2. <!--两个DIV-->  
  3. <html>  
  4. <body>  
  5. <div style="width:1000px;height:200px;margin-left:180px;margin-top:500px;location:center;border:none;background-color:red;position:absolute"></div>  
  6. <div style="width:1000px;height:200px;margin-left:180px;margin-top:500px;location:center;border:none;background-color:red;position:absolute;transform:rotate(90deg);"></div>  
  7. </body>  
  8. </html>  
[html] view plain copy
 
  1. <!DOCTYPE html>  
  2. <!--三个DIV-->  
  3. <html>  
  4. <body>  
  5. <div type="margin:auto">  
  6. <div style="width:1000px;height:200px;margin-left:180px;margin-top:500px;location:center;border:none;background-color:red;position:absolute"></div>  
  7. <div style="width:1000px;height:200px;margin-left:180px;margin-top:500px;location:center;border:none;background-color:red;position:absolute;transform:rotate(90deg);"></div>  
  8. </div>  
  9. </body>  
  10. </html>  
[html] view plain copy
 
    1. <!DOCTYPE html>  
    2. <!--五个DIV-->  
    3. <html>  
    4. <body>  
    5. <div style="width:200px;height:200px;margin-left:500px;margin-top:100px;border:none;background-color:red;position:absolute"></div>  
    6. <div style="width:200px;height:200px;margin-left:300px;margin-top:300px;border:none;background-color:red;position:absolute"></div>  
    7. <div style="width:200px;height:200px;margin-left:500px;margin-top:300px;border:none;background-color:red;position:absolute"></div>  
    8. <div style="width:200px;height:200px;margin-left:700px;margin-top:300px;border:none;background-color:red;position:absolute"></div>  
    9. <div style="width:200px;height:200px;margin-left:500px;margin-top:500px;border:none;background-color:red;position:absolute"></div>  
    10. </body>  
    11. </html>  

WEB前端面试题 分别使用2个、3个、5个DIV画出一个大的红十字

原文地址:https://www.cnblogs.com/yangguoe/p/8467887.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved