用html5制作企鹅,无HTML元素构建的企鹅图标

这篇博客展示了如何使用CSS实现独特的网页背景、头部元素和内容样式。通过body的背景色和内边距设置,创建了舒适的阅读环境。同时,利用伪元素和定位技巧,设计了复杂的头部形状,并添加了动态效果。此外,还巧妙地运用了不同元素的边框半径和旋转,营造出立体感和视觉吸引力。
摘要由CSDN通过智能技术生成

CSS

语言:

CSSSCSS

确定

body {

background: #ccc;

padding: 50px;

}

body:before {

content: "Abdullah AbuSall (abdullah-abusall.com)" "\aNo HTML Tags Added";

display: block;

width: 320px;

position: absolute;

top: 10px;

line-height: 2em;

font-family: monospace;

}

head {

display: block;

width: 200px;

height: 250px;

background: #FFF;

margin: 10px auto;

border: 30px solid #171717;

border-bottom-left-radius: 150px 100px;

border-top-left-radius: 150px 300px;

border-top-right-radius: 150px 300px;

border-bottom-right-radius: 150px 100px;

position: relative;

text-indent: -9999em;

}

head script,

head script:before {

content: "";

display: block;

width: 10px;

height: 20px;

background: #000;

border-radius: 50%;

position: absolute;

top: 40px;

left: 70px;

}

head script:before {

left: auto;

top: 0;

right: -50px;

}

head meta:first-of-type {

display: block;

width: 75px;

height: 30px;

background: #FF7F2A;

border-bottom-left-radius: 100%;

border-bottom-right-radius: 100%;

position: absolute;

bottom: 50%;

left: 50%;

-webkit-transform: translateX(-50%);

transform: translateX(-50%);

}

head meta:last-of-type,

head meta:last-of-type:before {

content: "";

display: block;

width: 75px;

height: 75px;

background: #171717;

border-bottom-left-radius: 150px 100px;

border-top-left-radius: 150px 300px;

border-bottom-right-radius: 150px 100px;

position: absolute;

top: 30%;

left: 0;

-webkit-transform: translateX(-90px) rotate(40deg);

transform: translateX(-90px) rotate(40deg);

}

head meta:last-of-type:before {

left: auto;

top: -200px;

right: -140px;

border-top-left-radius: 0;

border-top-right-radius: 150px 300px;

-webkit-transform: translateX(90px) rotate(-80deg);

transform: translateX(90px) rotate(-80deg);

}

head link:first-of-type,

head link:first-of-type:before {

content: "";

display: block;

width: 75px;

height: 75px;

background: #FF7F2A;

border-bottom-left-radius: 150px 100px;

border-top-left-radius: 150px 300px;

border-top-right-radius: 150px 300px;

border-bottom-right-radius: 150px 100px;

position: absolute;

top: 100%;

left: -10px;

z-index: -1;

-webkit-transform: rotate(20deg);

transform: rotate(20deg);

}

head link:first-of-type:before {

left: auto;

top: -50px;

right: -150px;

-webkit-transform: rotate(-40deg);

transform: rotate(-40deg);

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值