I've been challenged to a CSS Battle!

Поділитися
Вставка
  • Опубліковано 27 жов 2024

КОМЕНТАРІ • 392

  • @fnd4086
    @fnd4086 3 роки тому +586

    Thanks again Kevin for the battle! Rematch sometime?

    • @KevinPowell
      @KevinPowell  3 роки тому +79

      Thank you, it was a blast, and we will definitely need to have a rematch one of these days!

    • @geoorge1000
      @geoorge1000 3 роки тому +4

      Awesome battle!

    • @blockwest2379
      @blockwest2379 3 роки тому +5

      congrats Sir, nice approaches!!!

    • @alkhemist6631
      @alkhemist6631 3 роки тому +7

      I enjoyed the different approaches. This was awesome

    • @tinmancode
      @tinmancode 3 роки тому +3

      fun to watch, painful to live through your positioning struggles struggles. Kevin you do great work

  • @DanielBrownsan
    @DanielBrownsan 3 роки тому +611

    Me: "I'll never understand people who sit around and watch other people play video games."
    Also me: (Watches 33 minutes of CSS battles.)

    • @MerthanMerter
      @MerthanMerter 3 роки тому +13

      probably cuz this one is useful

    • @heliusuniverse7460
      @heliusuniverse7460 3 роки тому +38

      @@MerthanMerter ah yes, drawing images using css is useful of course

    • @multiarray2320
      @multiarray2320 3 роки тому +10

      @@heliusuniverse7460 its educational

    • @LordmkKING67
      @LordmkKING67 2 роки тому +4

      @@multiarray2320 indeed. Im taking notes of some new code parts n explanation of what it does as i watch

    • @abhijeets
      @abhijeets 2 роки тому +3

      @@heliusuniverse7460 off cource it is, you can do all sorts of stuffs in website by mastering CSS well, and these stuffs are one the best way to do it.

  • @diegomarzo4001
    @diegomarzo4001 3 роки тому +107

    Minute 2: aspect-ratio: 1, I just learned the thing of the day
    Thank you Kevin :)

    • @madara_uchiha_WB
      @madara_uchiha_WB 3 роки тому +1

      Same I learned bro now.. 😊😊👍

    • @programmingwithraahim
      @programmingwithraahim 3 роки тому +1

      @@madara_uchiha_WB Yeah I learned the same thing in the second minute. This is Crazy.

    • @madara_uchiha_WB
      @madara_uchiha_WB 3 роки тому +1

      @@programmingwithraahim yeah be too, as you can see even the cssbatlle interface couldn't recognise it it wasnt colored normally....

  • @agilmo
    @agilmo 3 роки тому +280

    Kevin: let's see the z-index;
    Me: the pain is finally over;
    Kevin: *selects z-index; -1; still not a clue*;
    Me: *screams*;
    Best thriller movie of the year

    • @andreasnulein782
      @andreasnulein782 3 роки тому +2

      same 😨

    • @jgm113
      @jgm113 3 роки тому +10

      Literally screaming at the guy and I couldn't even make a circle in the first place but I know that ; is fuckin wroooong

    • @ChandraKishore189
      @ChandraKishore189 2 роки тому +3

      I was literally screaming too, 'KEVIN!!!! Z-INDEX!!!!!' OCD came to the play lol.

    • @hyperanxe4957
      @hyperanxe4957 2 роки тому

      Yeah dude

  • @OnlineTutorialsYT
    @OnlineTutorialsYT 3 роки тому +169

    Great... i'll also try these three challenges.

    • @mhdfr
      @mhdfr 3 роки тому +4

      *oot*
      Ur vids helped me a lot man. Thanks

    • @benjamintettehnartey7937
      @benjamintettehnartey7937 3 роки тому +5

      Yeah I can't wait to see you do these challenges... Your css and Javascript videos is doing a magic for me outhere...
      I'm a better web developer cos of you. .. Thanks so much... Waiting for your css battle challenge tho

    • @OnlineTutorialsYT
      @OnlineTutorialsYT 3 роки тому +13

      Done, I completed all these three challenges, it was a lot of fun doing it

    • @benjamintettehnartey7937
      @benjamintettehnartey7937 3 роки тому +2

      You can do a Playlist for all the battles you've done.. Wll be so exciting to watch how you go about them

    • @tinmancode
      @tinmancode 3 роки тому

      @@benjamintettehnartey7937 yours too chairman

  • @-sevda
    @-sevda 3 роки тому +21

    the semi-colon part killed me when you finally noticed it. 😂 i recently experienced the same thing on a project.

  • @quickcodingtuts
    @quickcodingtuts 3 роки тому +80

    It's really great to see that even the pros make mistakes from time to time. It shows us that nobody knows everything there is to CSS at all times and the learning never really stops

  • @alexradu1921
    @alexradu1921 3 роки тому +95

    7:12 I'm dying 😂😂😂. I don't think Kevin expected that either although that's a really cool shape he got

    • @miles611
      @miles611 3 роки тому +3

      Was about to comment the same thing haha
      His face was absolutely priceless $$

    • @davidfonseca698
      @davidfonseca698 3 роки тому

      That made my day! 😂.😂.😂.

    • @jamjam3448
      @jamjam3448 Рік тому

      Yess I love the shape!

  • @lel0uchfr199
    @lel0uchfr199 3 роки тому +60

    you know that you could use border-bottom-color: transparent; border-top-color: trasparent; and make it transform: rotate(45deg); , it's some logic

    • @tinmancode
      @tinmancode 3 роки тому +5

      totally spot on. everyone tackles the problems from a different angle

    • @amsprich
      @amsprich 3 роки тому +5

      I was sitting here thinking the same thing. :)

    • @niner8275
      @niner8275 3 роки тому +7

      And you could do it with just one div :-) this is the shortest I came up with:
      .thing, .thing::after {
      position: absolute;
      border-radius: 50%;
      }
      .thing {
      background: #aa445f;
      width: 190px;
      aspect-ratio: 1;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%) rotate(45deg);
      }
      .thing::after {
      content: "";
      inset: 30px;
      border: 30px solid;
      border-color: #f7ec7d transparent;
      }

    • @tinmancode
      @tinmancode 3 роки тому

      @@niner8275 I'm positive you can use px values for left and top and remove the translation

    • @lel0uchfr199
      @lel0uchfr199 3 роки тому

      @@niner8275 ? it takes less characters :)

  • @savinagetsova8429
    @savinagetsova8429 2 роки тому +11

    hi, I'm still a noob :D, but I think I came up with an interesting way to cut the border without using additional boxes:
    border-top: 30px solid #F7EC7D;
    border-bottom: 30px solid #F7EC7D;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    transform: rotate(45deg);

    • @Jordan_fm
      @Jordan_fm 2 роки тому +2

      Actually you can set the border-color instead for a minimal clean-up like in the way how you could do it with border-radius!
      border:30px solid;
      border-color: #F7EC7D transparent;
      transform: rotate(45deg);

  • @trigun2411
    @trigun2411 3 роки тому +7

    22:24 when semicolon haunts you even on the front-end

  • @Joel-B
    @Joel-B 3 роки тому +12

    Didn't expect you to make such hard work of the first challenge. Initial thought was to go from the inner/smaller circle and go outwards using a border (two sides transparent and rotated 45deg) and then a box-shadow to complete the shape.

  • @cssbattle
    @cssbattle 3 роки тому +25

    This was again a really fun challenge to watch, Kevin! Thanks for doing this!
    And the amazing designs you generated while experimenting with border-radius in the 3rd round - Priceless! 😊🙌🏼

    • @inkedcoder
      @inkedcoder 3 роки тому +1

      Any comment on why place items: center gave a different score than using flex?

    • @tinmancode
      @tinmancode 3 роки тому +1

      @@inkedcoder it could be an edge case behaviour thing and the evaluation engine could be using a different rendering engine that generates something different from what you see in the browser.

    • @cssbattle
      @cssbattle 3 роки тому +5

      @@inkedcoder THis video was probably shot long back...our scoring engine at that time might not be the latest one supporting these new universal properties. It should work as of today.

    • @_moore
      @_moore 3 роки тому

      Great site, really fun, thanks. I really want to see how people got the top scores on the latest battles though. Their code has 50% less characters than mine and I don't see how that's possible!? 🤯

    • @tinmancode
      @tinmancode 3 роки тому +1

      @@_moore lookout for the open targets

  • @MerthanMerter
    @MerthanMerter 3 роки тому +2

    I used to watch these and had no clue what you guys were doing at all. now I am actually understanding and even finding different (sometimes better) approaches myself. This happened only by watching and following you Kevin, so thank you so much for this.

  • @yahyasalimi3254
    @yahyasalimi3254 3 роки тому +13

    Task: name a button, that if you click a nuclear war starts
    Everybody else: ultraimportant-btn
    Kevin: a

  • @marcod.643
    @marcod.643 3 роки тому +6

    I paused the video and started the battle with you too, so much fun... thanks Kevin! 😀

    • @KevinPowell
      @KevinPowell  3 роки тому +3

      👍 - did you beat me?

    • @madara_uchiha_WB
      @madara_uchiha_WB 3 роки тому +1

      @@KevinPowell I am not sure that I can beat you but I did the whole in about 10 minutes.. :)

  • @diegomarzo4001
    @diegomarzo4001 3 роки тому +10

    The face of Kevin when it went to 7x% to 100% using Flex is a poem, like a really sad poem, Edgar Allan Poe level of sadness poem.

    • @abdulramonjemil
      @abdulramonjemil 5 місяців тому

      It's weird tho. I thought they would be painting a canvas of the design and compare colors to a canvas of the original pixel by pixel to arrive at a score

  • @kiranovatheofficial
    @kiranovatheofficial 3 роки тому +1

    Love the content, and its really helping me. Good energy and super chill vibe ☺️

  • @nehajain1
    @nehajain1 3 роки тому +8

    Watching Frank get 100% then Kevin moving the slider frantically to see the difference was hilarious, lol. I knew you would get it right soon enough.

  • @gouldmears2071
    @gouldmears2071 2 роки тому +1

    SE here. I did some full stack before, but seeing you knock out these challenges and some of your other videos makes me want to brush off my CSS again. Good stuff!

  • @chretien2580
    @chretien2580 3 роки тому +1

    This is a great watch! I love thinking along and seeing what solutions you guys come up with.

  • @mahadevovnl
    @mahadevovnl 3 роки тому +1

    I found all of these to be really easy if you take a second to look them over at the start. The last task was a centered square with 4 squares inside, each square then has a :before inserted in them (as you did) that displays half a circle, and then using the :nth-child selector you'd turn them around as needed... most often, any CSS problem is fixed by that kind of initial thinking and not figuring it out as you go, because if you get stuck you either/often fall into the sunk cost fallacy, or have to redo it all anyway...

    • @tinmancode
      @tinmancode 3 роки тому

      positioning is the biggiest issue followed by the shapes for all the battles, centered images occur the most and you the normal centering tricks to get those positions then work on the shapes.

  • @nitsanbh
    @nitsanbh 3 роки тому +2

    You confused face @ 7:13 is so good ♥️

  • @tonyseben
    @tonyseben Рік тому +2

    For the first challenge, we could just use a SINGLE div. Set background to maroon color, border-left border-right to yellow, outline again to maroon. Then rotate 45 degree.

  • @miles611
    @miles611 3 роки тому +7

    Man, this was a blast to watch!

  • @schwetang
    @schwetang 2 роки тому +1

    That was good. Frank's last one was impressive.
    I raged when I saw your z-index typo, Kevin.

  • @Chapali9a
    @Chapali9a 3 роки тому +9

    I really loved this challenge. The z-index typo had me in stitches lol was funny to watch as this happens to the best of us all the time.

  • @TheSP337
    @TheSP337 3 роки тому +8

    no matter what you do, no matter how much css gets easier, this at 17:07 happens to everyone. Even to Kevin. The moment when your happy smile fades away and you wonder, what is happening :D :D

  • @rishabapriyan7138
    @rishabapriyan7138 3 роки тому +3

    Cool battle.Learnt some things 😃.

  • @layaboutlout
    @layaboutlout 2 роки тому

    As somebody who is just starting out with TOP, I understand alot of what happened through the episode (of course not all the definitions) but seeing it come to life was like a lesson in itself, and actually really fun to watch, thanks!

  • @eh78787
    @eh78787 3 роки тому +3

    Fwiw, y'all should have tried using `border-left-color: transparent`, `border-right-color: transparent`, & `transform: rotate(45deg)` on the inner circle, with a chunky border.

    • @derxen
      @derxen 2 роки тому

      Exactly what I thought. This works like a charm. I got a score of 607 for this solution, which is pretty decent I guess.

  • @michaelfaith
    @michaelfaith 3 роки тому

    Man, i'm in so much of awe of how fast you go through these. Incredible.

  • @edwardbrosens
    @edwardbrosens 3 роки тому

    That look on your face after the second challenge, priceless. I know the feeling when messing up with a typo.

  • @fersahahmet9597
    @fersahahmet9597 3 роки тому +17

    This is really fun to watch apart from the mic issue of Frank. I love battles especially when Kevin does typoes and pissed off :p --ps:You are the King Kevin. There is nothing convince me otherwise

  • @Beastintheomlet
    @Beastintheomlet 2 роки тому +2

    17:39 This is how I always end up when working with CSS 😂
    22:20 the semicolon reveal, is being a developer to a T, I feel so seen

  • @DevMarco-
    @DevMarco- 3 роки тому +7

    Good to see that even fully fledged front end devs sometimes wonder about weird behaviours

  • @k-yo
    @k-yo 3 роки тому

    For the first one an element of the size of the circle with appropriate border-width and border-radius along with border-left-color and border-right-color: transparent would give the desired effect. Then just rotate -45deg with transform.

  • @ricardosandoval3848
    @ricardosandoval3848 2 роки тому +1

    Battle #1
    -100% match
    body {
    display: grid;
    place-items: center;
    background: #E38F66;
    }
    div {
    width: 200px;
    height: 200px;
    background: #AA445F;
    border-radius: 50%;
    display: grid;
    place-items: center;
    }
    span {
    height: 80px;
    width: 80px;
    border-radius: 50%;
    border: 30px solid #F7EC7D;
    border-right-color: #AA445F;
    border-left-color: #AA445F;
    transform: rotate(45deg)
    }

  • @mahmoudmheisen8031
    @mahmoudmheisen8031 3 роки тому +3

    for first one:
    .inner {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    border: 31px solid #F7EC7D;
    border-left-color: transparent;
    border-right-color: transparent;
    transform: rotate(45deg);
    }
    better than adding other classes/divs/overflows, got 99.9% from first try

    • @tinmancode
      @tinmancode 3 роки тому +2

      You could totally solve it without even adding any html element. Just use Css. The output window is an with an html and body element in it by default.

    • @aayush_karna
      @aayush_karna 3 роки тому +2

      @@tinmancode bruh

  • @ayushbisht7363
    @ayushbisht7363 2 роки тому

    Thanks Kevin,
    I had also tried the lock up challenge, and would love to share my approach...
    I do this stuff, by keeping only the top and bottom border as yellow color and rotating it to - 135deg...
    This will save some extra line of code in our css..

  • @Chickenskout
    @Chickenskout 3 роки тому

    Need more battle content keep it up! Hella fun to watch

  • @LuisReyes-zs4uk
    @LuisReyes-zs4uk 3 роки тому

    great watch, guys... more of this, Kevin, please! thank you sir.

  • @VictoriousVipin
    @VictoriousVipin 3 роки тому

    Superb ...kevin and Frank.👍

  • @mihairusu7941
    @mihairusu7941 2 роки тому

    Woooow...Kevin is a monster. How he used those pseodo-elements in 3rd challenge in order to cut those circles. He is very talented in my opinion. Thx for the great battle! Had a lot of fun. 😅

  • @dannyr2976
    @dannyr2976 3 роки тому

    I duuno whether I'm over simplifying things, but for the last challenge why not just have four boxes ('outer' as two rows of two) positioned 'absolute' and an overflow of 'hidden', within each place another nested box inside each ('inner', also positioned as 'absolute') and apply a border-radius, then position 50% either left, right, top or bottom (depending on the direction and the inner shape) so half the div will be filled and the other hidden. Either way brilliant to watch!

  • @salmaabousaid6905
    @salmaabousaid6905 2 роки тому

    To solve the issue of the first problem, the one they solved by overflow hidden, I put a circle above that region , and used a box shadow. I made the circle color transparent, and the box shadow was yellowish like the background. This helped hide the bit of the box that was getting out of the circle.

  • @reecevaughan4225
    @reecevaughan4225 3 роки тому +1

    Finally, something that I understand! CSS may be my calling!

  • @JoseRodriguez-xu1jz
    @JoseRodriguez-xu1jz 3 роки тому +2

    The other guy sounds like a robot sinking in the ocean

  • @barijade
    @barijade 3 роки тому +1

    Purely HECKED by a semi-colon; the real struggle LOL

  • @rohan1765
    @rohan1765 3 роки тому +10

    Nothing against Frank but for me Kevin is always the best.

  • @maelstrom57
    @maelstrom57 3 роки тому

    These are great. I like pausing the video and trying to solve the challenges myself (with unlimited time hehe).

  • @oggatog3698
    @oggatog3698 3 роки тому

    15:16 I think you could also just provide multiple entries for box-shadow, but I think you'd need a bunch of them to avoid having a kind of "caterpillar" effect. The div is probably the way to go.

  • @mykalimba
    @mykalimba 3 роки тому +6

    22:18 That site should have a CSS linter for situations like this. 🤦‍♂

    • @KevinPowell
      @KevinPowell  3 роки тому +1

      Just some better syntax highlighting would make me so happy 😂

    • @tinmancode
      @tinmancode 3 роки тому

      Totally. I think that's a feature when you have a paid account

  • @ИльясАппаков-и8у

    Interesting fact, if you using border-radius and need to get only two of visible borders like in the first battle you just can make other two transparent and it will work

  • @realharami
    @realharami 3 роки тому

    Thank you both of you for participation and sharing that with us!

  • @MentorMode
    @MentorMode 3 роки тому

    1st one was very easy all we needed was a div which is purple located in the center and we needed border with different colors for 4 sides as well as border-radius after all we needed box-shadow with purple it would take like 3 minutes max but great video thank you.

  • @KennTollens
    @KennTollens 2 роки тому

    Round one where everything works and look perfect, but the program deducts points for your choice of code. That is how my teachers would grade me. I learn a lot watching someone else code, mostly because I know barely anything about css. It is super nice to see how someone else thinks through the problem.

  • @lucasrokam
    @lucasrokam 3 роки тому

    Those half circles can be archived with gradient background. I think it's a more elegant solution.

  • @AminalCreacher
    @AminalCreacher Рік тому

    I played along and was surprised at how well I did. Maybe there's a css showdown in our future, should I ever become a patron >:)

  • @sharafmakahleh4125
    @sharafmakahleh4125 3 роки тому +1

    In the third challenge, what I think would be a better approach is to make two halfs of the circle on one color, and positioning it, then duplicating it and applying rotation to make them go the other way & chang the color

  • @hjge1012
    @hjge1012 2 роки тому

    That z-index issue you had there; I have that all the time as well.

  • @funnyanimalworld7579
    @funnyanimalworld7579 3 роки тому +1

    Kevin is to smart and is using not ordinary ways thus getting punished :D. And pro tip always use 100% browser scale

  • @ruskasielu6261
    @ruskasielu6261 11 місяців тому

    For the first challenge I feel like maybe you could use a yellow border on the center circle, but only on the bottom and top side, then rotate it 45°. I haven't tried it personally though

  • @BadGirl-pn3qu
    @BadGirl-pn3qu 3 роки тому

    That was great! Different approach the same result!

  • @davideglass
    @davideglass 3 роки тому

    This was great fun to watch, even though I was screaming at my monitor about the z-index semicolon!

  • @Ryangosden
    @Ryangosden 3 роки тому +1

    Thanks for exposing me to CSS battles! Will definitely keep me busy

  • @dinesh.m7341
    @dinesh.m7341 Рік тому

    For the 1st object in the Inner Circle you could have used border top bottom radius as transparent and then use rotate property.....

  • @KonesThe
    @KonesThe 3 роки тому

    I don't even know css... but this was really fun! Going to try to create a website with CSS and JS once I finish my Flutter project

  • @MrSupdup
    @MrSupdup 2 роки тому

    Man that z-index; -1; typo sent me wild. Never yelled at a screen before.

  • @alinawaz4034
    @alinawaz4034 3 роки тому +1

    17:32 O no you put a semicolon instead on colon in line 27 that is why it is now working.

  • @rnt45t1
    @rnt45t1 3 роки тому +2

    I've been coding emails too long..... this looks much more fun!

    • @changoviejo9575
      @changoviejo9575 3 роки тому +1

      Oh my goth, random stranger, I really feel for you.

  • @SitSkw
    @SitSkw 2 роки тому

    Battle #2 took me 11min :) It's so fun to challenge myself with you :)

  • @sudarrshang8922
    @sudarrshang8922 3 роки тому +1

    Pls pls make more challenges of like this , they are really awesome 😎

  • @hidami3241
    @hidami3241 3 роки тому +2

    for the inner circle cant we use something like
    border-left: none;
    border-right:none;
    and then
    transform:rotate(deg, any%);?
    it would work too, right?

    • @mostafagouda1526
      @mostafagouda1526 3 роки тому +3

      none wouldn't work, you have to make it transparent and rotate 45 degrees

    • @tinmancode
      @tinmancode 3 роки тому

      @@mostafagouda1526 you are right

  • @DannyHille
    @DannyHille 3 роки тому +1

    It's actually nice to see the experts fumble a bit 😃

  • @MarcJensan
    @MarcJensan 2 роки тому

    I like how you went overflow: hidden; instead of border-radius: 100% 0px 0px 0px; I do not know grid or anything as I only do a little CSS sometimes in my spare time, but was able to complete the challenge in time as well. Maybe you forgot that radius is from the center of a circle to the edge, so when you say 50% you basically said make it curve like a circle with half of half of the width of the square instead of the whole of the half of the width. (:

  • @ursklahr5601
    @ursklahr5601 3 роки тому +1

    it is really amazing what you guys can do with CSS.
    But a question - when do you use these functions in real projects? Besides the icon fonts is it not more reasonable to create SVG graphics instead (more understandable, better maintainable)?

    • @KevinPowell
      @KevinPowell  3 роки тому +2

      Oh for sure, SVG all the way for this type of thing. This is more about having fun and getting creative with CSS

  • @phpn99
    @phpn99 3 роки тому

    That's what one calls, "drawing with a Buick". Just attach a pen to the bumper.

  • @edwardbrosens
    @edwardbrosens 3 роки тому

    This is so much fun, thank you Kevin.

  • @sir_afk
    @sir_afk 2 роки тому

    This was awesome, great tool.

  • @hrantelmayan
    @hrantelmayan 2 роки тому

    I swear i had been looking at that semicolon and just waiting for you to find out 😭

  • @mody-pq8kd
    @mody-pq8kd 2 роки тому

    5:00
    It’s simple, man))
    body{
    background:#000;
    }
    .outer{
    display:flex;
    align-items:center;
    justify-content:center;
    width:100px;
    height:100px;
    background:#f2f2f2;
    border-radius:50%;
    }
    .inner{
    width:30px;
    height:30px;
    background:#f2f2f2;
    border-top:15px solid black;
    border-bottom:15px solid black;
    border-left:15px solid #f2f2f2;
    border-right:15px solid #f2f2f2;
    border-radius:50%;
    transform:rotate(45deg);
    }

  • @TesterAnimal1
    @TesterAnimal1 2 роки тому

    Wouldn’t clip-path be a good solution for the pinwheel semicircles?

  • @thatcoul
    @thatcoul 3 роки тому

    Kevin always picks the hardest solutions

  • @chinmayk8004
    @chinmayk8004 Рік тому

    frank's border radius idea was my first approach. I was horrified seeing Kevin choose another path.

  • @OsirisDRa
    @OsirisDRa 3 роки тому

    I tried the first challenge by myself - you can do it with just 2 DIVs. Make the second one without background-color - use border only

  • @DipayanRoyZed
    @DipayanRoyZed 3 роки тому

    1st Battle is actually simpler than I thought, Linear gradient does the job very easily.

  • @ahmedm.ibrahim
    @ahmedm.ibrahim 3 роки тому

    That's a great vid 💚💚
    But in the first challenge why didn't u just use 2 divs & the inner has border with left & right transparent with rotation 45deg??😅

  • @FatRogSlim
    @FatRogSlim 3 роки тому +2

    border radius 100% no border left and right, rotation 45deg

  • @fernandobaroni1497
    @fernandobaroni1497 3 роки тому

    This was so nice!

  • @YuFanLou
    @YuFanLou 3 роки тому

    Heard CSSBattle for the first time, so tried to follow the first challenge and got royally confused by the different result I got from display grid and place items center. Turns out Safari and Firefox do not set the height of body to the height of its containing like Chromium does. I don't know where else to report this inconsistency.
    In addition, Safari and Firefox looks the same but are actually different. Chromium centers the div vertically presumably because it computes the height of body to be the same as the containing . Firefox doesn't presumably because it computes the height of body to be the height of the contents of body. Safari computes the height of body to be the containing , yet doesn't center the div vertically!
    I know there are inconsistencies between browsers, but I did not expect inconsistency in such a simple case. Isn't this regulated by the CSS Spec?

  • @itsplus5396
    @itsplus5396 3 роки тому +1

    The semicolon after freakin z index dude...

  • @purpleAiPEy
    @purpleAiPEy 3 роки тому

    Oh man.. Kevin can you please do a breakdown of the top solution for Challenge target #84?
    I feel like I entered a new world with the svg and * appearing after closing braces?? What's with that??
    Anyways, your videos are taking me to the next level of css. I've been doing battles because of you! But apparently my 100% is far different from the pros.

  • @nustaniel
    @nustaniel 4 місяці тому

    Wanted to try my hand at that first one since I saw all those divs. Here's what I came up with:
    body {
    background: #E38F66;
    }
    div {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 200px;
    height: 200px;
    background: #AA445F;
    border-radius: 50%;
    &::before {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 40%;
    height: 40%;
    border: 30px solid;
    border-color: #F7EC7D transparent;
    border-radius: 50%;
    transform: rotate(45deg);
    }
    }

    • @nustaniel
      @nustaniel 4 місяці тому

      I also think the goal of the least characters possible becomes idiotic when you got to remove all whitespace that can be taken out, put everything on a single line, use inline style="" tags instead of and so on. I like your approach much better, going after a 100% match, not the least amount of characters. The actual CSSBattle seems to promote bad coding habits where code becomes unreadable in order to get the lowest amount of characters.

  • @TomasMisura
    @TomasMisura 3 роки тому

    thank you very much for this video, I have a learned a lot. it seems to be flex is going to be preferable technology for the web layouts :)

  • @tope-oficial
    @tope-oficial 2 роки тому

    question on first exercise, why dont put a before on this div, give him a border, hide left and right for example and rotate 45 deg ?

  • @iliangrekov5885
    @iliangrekov5885 2 роки тому

    My idea about #27 is only one div with border + shadow for the 3 layers border top and bottom transparent and rotate at 135deg

  • @jin_9707
    @jin_9707 3 роки тому

    It’s my Fav series!

  • @csy897
    @csy897 3 роки тому

    the second I saw z-index; -1
    I was like, damn, I'm gonna be screaming at my screen for a while

  • @singularity1130
    @singularity1130 3 роки тому

    First one I had to pause and try myself. Ended up using clip-path: polygon() to individually shape the boxes within the outer circle. Def should've just made my square's smaller and align them more towards the center of the circle instead of keeping them big and over engineering the problem.