前端入门:HTML(CSS边框综合案例)

案例:

源代码:

css-borders.html:

<body>

<div id="square"> </div>

<br>

<div id="triangle"> </div>

<br>

<div id="trapezium"> </div>

<br>

<div id="windmills">

<div class="box1"></div>

<div class="box2"></div>

<div class="box3"></div>

<div class="box4"></div>

</div>

</body>

border-style.css:

#square {

width: 0px;

height: 0px;

border-top: 50px solid red;

border-right: 50px solid yellow;

border-bottom: 50px solid blue ;

border-left: 50px solid green;

}

#triangle {

width: 0px;

height: 0px;

border: 50px solid transparent;

border-top: 50px solid red;

}

#trapezium {

width: 0px;

height: 0px;

border-right: 50px solid blue;

border-bottom: 50px solid blue ;

border-left: 50px solid transparent;

}

#windmills {

width: 200px;

height: 200px;

border: 2px solid gray;

}

#windmills div{

float: left;

}

#windmills .box1 {

width: 0px;

height: 0px;

border: 50px solid transparent;

border-bottom: 50px solid red ;

}

#windmills .box2 {

width: 0px;

height: 0px;

border: 50px solid transparent;

border-left: 50px solid red ;

}

#windmills .box3 {

width: 0px;

height: 0px;

border: 50px solid transparent;

border-right: 50px solid red ;

}

#windmills .box4 {

width: 0px;

height: 0px;

border: 50px solid transparent;

border-top: 50px solid red ;

}

相关推荐
PineappleCoder4 小时前
还在重复下载资源?HTTP 缓存让二次访问 “零请求”,用户体验翻倍
前端·性能优化
拉不动的猪4 小时前
webpack编译中为什么不建议load替换ast中节点删除consolg.log
前端·javascript·webpack
李姆斯4 小时前
Agent时代下,ToB前端的UI和交互会往哪走?
前端·agent·交互设计
源码获取_wx:Fegn08954 小时前
基于springboot + vue健身房管理系统
java·开发语言·前端·vue.js·spring boot·后端·spring
闲谈共视4 小时前
基于去中心化社交与AI智能服务的Web钱包商业开发的可行性
前端·人工智能·去中心化·区块链
CreasyChan5 小时前
C# 反射详解
开发语言·前端·windows·unity·c#·游戏开发
JIngJaneIL5 小时前
基于Java+ vue智慧医药系统(源码+数据库+文档)
java·开发语言·前端·数据库·vue.js·spring boot
hashiqimiya6 小时前
两个步骤,打包war,tomcat使用war包
java·服务器·前端
零度@7 小时前
Java中Map的多种用法
java·前端·python
yuanyxh7 小时前
静默打印程序实现
前端·react.js·electron