html把div变得好看,一些好看的css样式

.box1 {

height: 25em;

width: 20em;

background: rgb(255, 128, 0);

background: -moz-linear-gradient(0deg, yellow, red);

background: -o-linear-gradient(0deg, yellow, red);

background: -webkit-linear-gradient(0deg, yellow, red);

background: linear-gradient(90deg, yellow, red);

float: left;

}

h1 {

color: gray;

}

@supports (text-shadow: 0 0 .3em gray) {

h1 {

color: transparent;

text-shadow: 0 0 .3em gray;

}

}

button {

padding: .3em .8em;

border: 1px solid rgba(0,0,0,.1);

background: #58a linear-gradient(hsla(0,0%,100%,.2),transparent);

border-radius: .2em;

box-shadow: 0 .05em .25em rgba(0,0,0,.5);

color: white;

text-shadow: 0 -.05em .05em rgba(0,0,0,.5);

font-size: 125%;

line-height: 1.5;

}

button.ok {

background-color: #6b0;

}

button.cancel {

background-color: #c00;

}

ul { --accent-color: purple; }

ol { --accent-color: rebeccapurple; }

li { background: var(--accent-color); }

.box2 {

width: 10em;

height: 8em;

float: left;

border: 10px solid hsla(0,0%,100%,.5);

background-clip: padding-box;

margin: 2em;

}

.box3 {

width: 10em;

height: 8em;

background: yellowgreen;

box-shadow: 0 0 0 10px #655,

0 0 0 15px deeppink,

0 2px 5px 15px rgba(0,0,0,.6);

float: left;

margin: 2em;

}

.box4 {

width: 10em;

height: 8em;

background: tan;

border-radius: .8em;

padding: 1em;

box-shadow: 0 0 0 .6em #655;

outline: .6em solid #655;

float: left;

}

.box5 {

width: 10em;

height: 8em;

float: left;

margin: 2em;

background: linear-gradient(45deg,

#fb3 25%, #58a 0, #58a 50%,

#fb3 0, #fb3 75%, #58a 0);

background-size: 30px 30px;

}

.box6 {

width: 10em;

height: 8em;

float: left;

background: #655;

background-image: radial-gradient(tan 30%, transparent 0),

radial-gradient(tan 30%, transparent 0);

background-size: 30px 30px;

background-position: 0 0, 15px 15px;

}

.box7 {

width: 10em;

height: 8em;

float: left;

padding: 1em;

border: 1em solid transparent;

background: linear-gradient(white, white) padding-box,

repeating-linear-gradient(-45deg,

red 0, red 12.5%,

transparent 0, transparent 25%,

#58a 0, #58a 37.5%,

transparent 0, transparent 50%)

0 / 5em 5em;

}

@keyframes ants { to { background-position: 100% } }

.box8 {

width: 10em;

height: 8em;

float: left;

margin: 2em;

padding: 1em;

border: 1px solid transparent;

background:

linear-gradient(white, white) padding-box,

repeating-linear-gradient(-45deg,

black 0, black 25%, white 0, white 50%

) 0 / .6em .6em;

animation: ants 12s linear infinite;

}

.box9 {

width: 10em;

height: 8em;

float: left;

background: blue;

border-radius: 50% / 50%;

}

.box10 {

width: 10em;

height: 8em;

float: left;

position: relative;

}

.box10::before {

margin-left: 2em;

content: ''; /* 用伪元素来生成一个矩形 */

position: absolute;

top: 0; right: 0; bottom: 0; left: 0;

z-index: -1;

background: #58a;

transform: skew(45deg);

}

.box11 {

margin-left: 5em;

width: 10em;

height: 8em;

float: left;

}

img {

clip-path: polygon(50% 0, 100% 50%,

50% 100%, 0 50%);

transition: 1s clip-path;

}

img:hover {

clip-path: polygon(0 0, 100% 0,

100% 100%, 0 100%);

}

.box12 {

width: 10em;

height: 8em;

float: left;

margin-left: 2em;

background: #58a;

background:

linear-gradient(-45deg, transparent 15px, #58a 0)

right,

linear-gradient(45deg, transparent 15px, #655 0)

left;/* 若使用径向渐变radial-gradient()就是变成弧形切角 */

background-size: 50% 100%; /*背景大小,第一个是宽度,第二个是高度 */

background-repeat: no-repeat;

}

.box13 {

margin-top: 3em;

width: 10em;

height: 8em;

margin-left: 2em;

font-variant-ligatures: common-ligatures

discretionary-ligatures

historical-ligatures;

float: left;

}

.box14 {

width: 10em;

height: 8em;

margin-left: 3em;

background: #203;

color: #ffc;

text-shadow: 0 0 .1em, 0 0 .3em;

float: left;

}

.box14 a {

background: #203;

color: white;

transition: 1s;

}

.box14 a:hover {/*:hover 状态下把文字本身隐藏掉,那它看起来真的就像在慢慢变模糊*/

color: transparent;

text-shadow: 0 0 .1em white, 0 0 .3em white;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
什么是CSSCSS 是层叠样式表 ( Cascading Style Sheets ) 的简称。 CSS 是一种标记语言,属于浏览器解释型语言,可以直接由浏览器执行,不需要编译。 CSS 是用来表现HTML或XML的标记语言。 CSS 是由W3C的CSS工作组发布推荐和维护的. CSS 是编程入门人员的必修课,运用CSS样式可以让页面变得美观。 CSS语法由三部分构成:选择器、属性和值: selector {property: value} CSS3 是最新的 CSS 标准。 css3比css多了一些样式设置而已。 css3是向前兼容的,也就是说,css中有效的code在css3也有效。 一个csscss3都有效的code,如果浏览器不支持css3,那么只会以css样式显示。最常见的就是圆弧角。一个只在css3中有效的code,如果浏览器不支持css3,那么其显示效果就不会出现。 css3和css,在编写code的时候,除了对一些css3中新出现的属性设置,其它完全一样。 CSS3新增属性 box-shadow(阴影效果) border-colors(为边框设置多种颜色)  boder-image(图片边框) text-shadow(文本阴影) text-overflow(文本截断) border-radius(圆角边框) opacity(不透明度)  box-sizing(控制盒模型的组成模式):指定两个boxes接壤 resize(元素缩放):指定一个div元素,允许用户调整大小 outline(外边框) background-origin(指定背景图片从哪里开始显示) background-clip(指定背景图片从什么位置开始裁切)  background(为一个元素指定多个背景)

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值