html 形状里面有字,html – 创建一个包含文本形状的雪花形状

我正在为冬季在我的网页上创建一个雪花.

我尝试的第一件事是用SVG创建它:

ItttS.png

Koch Snowflake Frac

Here is a paragraph that requires word wrap

我无法获得< foreignObject>即使我没有在IE浏览器中支持它.

没有必要支持旧的IE浏览器,但我至少要支持其中的一个.

顶部细小的细节,形状没有关闭.

然后我尝试用CSS创建一个雪花:

.snowflake {

position: absolute;

width: 200px;

display: inline-block;

border-bottom: 10px solid cornflowerblue;

top: 200px;

left: 100px;

background-color: white;

}

.snowflake:before {

position: absolute;

content: "";

display: inline-block;

width: 50px;

border-bottom: 10px solid cornflowerblue;

transform: rotate(45deg);

top: -20px;

}

.snowflake:after {

position: absolute;

content: "";

display: inline-block;

width: 50px;

border-bottom: 10px solid cornflowerblue;

transform: rotate(-45deg);

top: 20px;

}

.smallbranch {

position: absolute;

right: 0px;

display: inline-block;

width: 50px;

border-bottom: 10px solid cornflowerblue;

transform: rotate(45deg);

top: 17px;

box-shadow: -130px -5px 0px 0px cornflowerblue;

}

.smallbranch:before {

position: absolute;

content: "";

display: inline-block;

width: 50px;

border-bottom: 10px solid cornflowerblue;

transform: rotate(90deg);

top: -22px;

left: -22px;

box-shadow: 130px -5px 0px 0px cornflowerblue;

}

.circle {

position: absolute;

left: 50%;

width: 50px;

height: 50px;

border-radius: 50%;

border: 5px solid cornflowerblue;

background-color: white;

transform: translate(-50%, -50%);

}

.circle:before {

position: absolute;

content: "";

display: inline-block;

width: 50px;

border-bottom: 10px solid cornflowerblue;

transform: rotate(90deg);

top: -52px;

left: 20px;

transform: rotate(-45deg);

}

.circle:after {

position: absolute;

content: "";

display: inline-block;

width: 50px;

border-bottom: 10px solid cornflowerblue;

transform: rotate(90deg);

top: 102px;

left: 20px;

transform: rotate(45deg);

}

.branch {

position: absolute;

display: inline-block;

height: 200px;

border-right: 10px solid cornflowerblue;

left: 50%;

top: -100px;

}

Text in here

这是我最好的尝试CSS.

现在这里显示文本,但不在一行.我的想法是在网站上的标志或按钮中使用.所以我不认为我将需要线条功能的形状,但它将是一个加号,如果它有.

我想要创建的形状:

uGQmL.png

TL; DR

我想要的是在形状中间有文字的雪花.

我要求一个解决方案,文本可以是任何长度,仍然在形状.

只要形状是中心的文字,就可以创建与我所尝试的形状完全相同的形状.我不知道文本将要多长时间,所以形状必须包含文本.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值