gpt4 book ai didi

html - 有没有机会使用 CSS/HTML 技巧创建图像,比如 CD Trey with CD Rings

转载 作者:行者123 更新时间:2023-11-28 02:25:45 25 4
gpt4 key购买 nike

  • 我正在使用 CSS 和 HTML 创建图像(CD trey 和 CD,请不要与想象中的一样)。
  • 我试过但需要像Task-Image这样的图片
  • 在这里我尝试了我的代码

对于 Stand HTML

<div class="baseStand">
<span class="stand"></span>
</div>

CSS

.stand {
content: "\007c";
height: 400px;
width: 40px;
background-color: grey;
left: 88px !important;
position: fixed !important;
top: 12% !important;
border-radius: 15px;
}

这里是指环 HTML

<div class="main_div">    
<div class="div-list-1">
<ul class="tabrow">
<li style="background-color: red">
<a style="cursor: pointer;" data-toggle="modal" data-target="#modal">Tabd-1</a>
</li>

<li style="background-color: green">
<a style="cursor: pointer;" data-toggle="modal" data-target="#modal">Tabd-2</a>
</li>

<li style="background-color: yellow" class="selected">
<a style="cursor: pointer;" data-toggle="modal" data-target="#modal">Tabd-3</a>
</li>
<li style="background-color: blue">
<a style="cursor: pointer;" data-toggle="modal" data-target="#modal">Tabd-4</a>
</li>
</ul>
<span class="span-name">
<a class="span-name-1" style="cursor: pointer;">Name Here</a>
</span>
</div>
</div>

这里是CSS代码

.div-list-1 {
border-radius: 25px;
background: #73AD21;
height: 40px;
margin-top: 0px;
}
.span-name {
color: white;
text-align: center;
/* padding-left: 20%;
padding-bottom: 10%; */
margin: 0 auto;
display: block;
}

这里标签的CSS代码

.tabrow {
text-align: center;
list-style: none;
/* margin: 200px 0 20px; */
padding: 0px;
line-height: 20px;
height: 20px;
overflow: hidden;
font-size: 15px;
font-family: verdana;
position: relative;
margin-bottom: 0% !important;
}
.tabrow li:first-child{
border: 1px solid #AAA;
background: #D1D1D1;
background: -o-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
background: -ms-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
background: -moz-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
background: -webkit-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
background: linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
display: inline-block;
position: relative;
z-index: 0;
border-top-left-radius: 15px;
/* box-shadow: 0 3px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 #FFF;
text-shadow: 0 1px #FFF; */
margin: 0 -5px;
padding: 0 18px;
color: white;
font-weight: bold;
}
.tabrow li {
border: 1px solid #AAA;
background: #D1D1D1;
background: -o-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
background: -ms-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
background: -moz-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
background: -webkit-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
background: linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
display: inline-block;
position: relative;
z-index: 0;
margin: 0 -5px;
padding: 0 18px;
color: white;
font-weight: bold;
}
.tabrow li:last-child {
border: 1px solid #AAA;
background: #D1D1D1;
background: -o-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
background: -ms-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
background: -moz-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
background: -webkit-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
background: linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
display: inline-block;
position: relative;
z-index: 0;
border-top-right-radius: 15px;
margin: 0 -5px;
padding: 0 18px;
color: white;
font-weight: bold;
}
.tabrow a {
color: #FFF;
text-decoration: none;
font-size: medium;
font-family: Verdana, Geneva, Tahoma, sans-serif;
}
  • 使用上面的代码我会得到这样的图像 Tried-Code

  • 在这里检查代码Editor-Code

  • 用 li/span 帮助处理这篇文章
  • 在此先感谢.. 我仍然没有得到任何解决方案。

最佳答案

这是一个结合变换和一些梯度的例子:

.CD {
width: 200px;
height: 200px;
margin: auto;
background:
linear-gradient(to bottom, #000 0,
#000 calc(50% - 20px), transparent calc(50% - 20px),
transparent calc(50% + 20px), #000 calc(50% + 20px))
center/3px 100%,
linear-gradient(to right, #000 0,
#000 calc(50% - 20px), transparent calc(50% - 20px),
transparent calc(50% + 20px), #000 calc(50% + 20px))
center/100% 3px,
radial-gradient(circle at center, transparent 20px, #000 21px, #000 23px, grey 24px);
background-repeat: no-repeat;
border: 2px solid;
border-radius: 100%;
position: relative;
transform: perspective(350px) rotateX(65deg);
}
.CD::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: inherit;
background-size: 3px 100%, 100% 3px, 0 0;
border-radius: inherit;
transform: rotate(45deg);
}
.bar {
width: 20px;
height: 74px;
margin: 25px auto -112px;
z-index: 1;
position: relative;
border-radius: 4px 4px 8px 8px;
background: #000;
}
.middle {
height: 110px;
width: 212px;
background:
linear-gradient(#000,#000) calc(100% - 18px) 10px/3px 50%,
linear-gradient(#000,#000) 18px 10px/3px 50%,
linear-gradient(#000,#000) center/4px 50%,
linear-gradient(#000,#000) top right/3px 50%,
linear-gradient(#000,#000) top left/3px 50%,
radial-gradient(85% 100% at top center,
red 75%,#000 76%,
#000 calc(76% + 3px) ,transparent calc(76% + 4px));
background-repeat:no-repeat;
margin: -90px auto 0;
}
.bottom {
height: 110px;
width: 212px;
background:
linear-gradient(#000,#000) top right/3px 50%,
linear-gradient(#000,#000) top left/3px 50%,
radial-gradient(85% 100% at top center,
green 75%,#000 76%,
#000 calc(76% + 3px) ,transparent calc(76% + 4px));
background-repeat:no-repeat;
margin: -70px auto;
position: relative;
z-index: -1;
}
<div class="bar"></div>
<div class="CD"></div>
<div class="middle"></div>
<div class="bottom"></div>

这里是标签:

.CD {
width: 200px;
height: 200px;
margin: auto;
background:
linear-gradient(to bottom, #000 0,
#000 calc(50% - 20px), transparent calc(50% - 20px),
transparent calc(50% + 20px), #000 calc(50% + 20px))
center/3px 100%,
linear-gradient(to right, #000 0,
#000 calc(50% - 20px), transparent calc(50% - 20px),
transparent calc(50% + 20px), #000 calc(50% + 20px))
center/100% 3px,
radial-gradient(circle at center, transparent 20px, #000 21px, #000 23px, grey 24px);
background-repeat: no-repeat;
border: 2px solid;
border-radius: 100%;
position: relative;
transform: perspective(350px) rotateX(65deg);
z-index:1;
}
.CD::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: inherit;
background-size: 3px 100%, 100% 3px, 0 0;
border-radius: inherit;
transform: rotate(45deg);
}
.bar {
width: 20px;
height: 74px;
margin: 25px auto -112px;
z-index: 2;
position: relative;
border-radius: 4px 4px 8px 8px;
background: #000;
}
.middle {
height: 110px;
width: 212px;
background:
linear-gradient(#000,#000) calc(100% - 18px) 10px/3px 50%,
linear-gradient(#000,#000) 18px 10px/3px 50%,
linear-gradient(#000,#000) center/4px 50%,
linear-gradient(#000,#000) top right/3px 50%,
linear-gradient(#000,#000) top left/3px 50%,
radial-gradient(85% 100% at top center,
red 75%,#000 76%,
#000 calc(76% + 3px) ,transparent calc(76% + 4px));
background-repeat:no-repeat;
margin: -90px auto 0;
display:flex;
}
.bottom {
height: 110px;
width: 212px;
background:
linear-gradient(#000,#000) top right/3px 50%,
linear-gradient(#000,#000) top left/3px 50%,
radial-gradient(85% 100% at top center,
green 75%,#000 76%,
#000 calc(76% + 3px) ,transparent calc(76% + 4px));
background-repeat:no-repeat;
margin: -70px auto;
position: relative;
z-index: -1;
}

.middle > span:first-child,
.middle > span:last-child{
height: 63px;
width: 15px;
margin:0 3px;
}
.middle > span:nth-child(2),
.middle > span:nth-child(3){
flex-grow:1;
height:83px;
}
.middle > span:first-child {
border-radius: 0 0 0 24px;
background: pink;
}
.middle > span:last-child {
border-radius: 0 0 24px 0;
background: orange;
}
.middle > span:nth-child(2) {
margin-right: 2px;
border-radius: 0 0 0 86px/0 0 0 24px;
background:blue;
}
.middle > span:nth-child(3) {
margin-left: 2px;
border-radius: 0 0 86px 0/0 0 24px 0;
background:purple;
}
.middle > span {
cursor:pointer;
}
.middle > span:hover {
filter:brightness(50%);
}
<div class="bar"></div>
<div class="CD"></div>
<div class="middle">
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<div class="bottom"></div>

关于html - 有没有机会使用 CSS/HTML 技巧创建图像,比如 CD Trey with CD Rings,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54141787/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com