CSS Battle #34 – Christmas Tree #1082
aishwarya-mali
started this conversation in
CSS Battles
Replies: 4 comments 1 reply
-
This solution unsettles me, but it works! Code Source – 604.58(100% match) {469 characters}<div a></div>
<div b></div>
<div c></div>
<style>
body {
background:#007065;
display:grid;
justify-content:center;
}
div {
width: 0;
height: 0;
border: 125px solid transparent;
border-top:0;
border-bottom: 100px solid #FFEECF;
}
[a] {
margin-top:42;
z-index:2;
}
[b] {
border-bottom-color:#F5C181;
margin-top: -92;
z-index:1
}
[c] {
border-bottom-color:#00A79D;
margin-top:-93
}
</style> |
Beta Was this translation helpful? Give feedback.
0 replies
-
Second verse, same as the first! (Today I learned that the hex value for fully transparent is Code Source – 606.04 (100% match) {440 characters}<p a></p>
<p b></p>
<p c></p>
<style>
body {
background:#007065;
}
p {
width:0;
height:0;
border:125px solid #1FE0;
border-top:0;
border-bottom:100px solid #FFEECF;
margin:auto;
position:relative;
}
[a] {
margin-top:50;
z-index:2;
}
[b] {
border-bottom-color:#F5C181;
margin-top:-50;
z-index:1;
}
[c] {
border-bottom-color:#00A79D;
margin-top:-50;
}
</style> |
Beta Was this translation helpful? Give feedback.
1 reply
-
I had to leave, but I managed to calculate the correct values to have conic gradients yield 100% match. Code Source – 620.45 {312}<c><b><a>
<style>*{background:#007065}
a,b,c {
position:fixed;
left:75;
width:250;
height:100;
background:conic-gradient(at 50%0,#0000 128.66deg,var(--c)0 231.34deg,#0000 0)
}
a {
--c:#FFEECF;
top:50
}
b {
--c:#F5C181;
top:100
}
c {
--c:#00A79D;
top:150 |
Beta Was this translation helpful? Give feedback.
0 replies
-
99.6% – 595.45{372}<p><p a><p b>
<style>
body{
background:#007065;
}
p{
width:0;
height:0;
border:125px solid transparent;
border-bottom:100px solid #FFEECF;
border-top:0;
margin:50 0 0 67;
position:relative
}
[a]{
margin-top:-49;
border-bottom-color:#F5C181;
z-index:-1
}
[b]{
margin-top:-50;
border-bottom-color:#00A79D;
z-index:-2 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Link to battle:
Let's battle! ⚔️
Copy the code block below to format your comment on the discussion thread:
What others will see:
This will result in a nice hidden bit like so:
Code Source – score {character count}
Beta Was this translation helpful? Give feedback.
All reactions