Skip to main content
View on YouTube to comment and like!

Syntax Video

We Tried CSSBattle’s New Versus Mode

Chapter 1 00:00

Transcript

Welcome to this CSS battle where today we're going to be playing a brand new mode called versus mode. So these are going to be one v one battles where the first person to get to 100% wins. Now today we're going to be doing round robin a tournament. So all of us are going to be battling against each other and whoever has the most wins at the end [music] is the winner. First up, Scott and I are going to battle. Are you ready Scott?

Hell yeah. All right, let's do it. All right, folks. I'm ready to go on this. Let's go. Let's go. Let's go. All right. Three 14. Oh, this is a long countdown. 10 [laughter] second countdown is brutal. Whoa. Okay. Three circles. Okay. I'm going to go ahead and just grab the background and set that on the body. And this is not shortest mode. It's just the first one to get to 100%.

This looks like a poop. Not my poop. My poop is much more healthy, but somebody's um I'm going to set this to have a border radius 100%. Uh I'm going to give this a class of circle cuz we're going to have Oh, actually, we'll just have one of them. And then we'll do a box shadow. So let's give this a class of circle. And the color is going to be the same.

[music] So color um let's just do zero on this bad boy. Let's do 100 pixels on this bad boy. Let's do Oh, the color should be the same. So let's [music] do color. I hope Scott doesn't remember to set the color cuz it's like a slightly red color. That's going to be hilarious if he tries to use the existing red color.

Let's do another box shadow. This one is going to be slightly over from it. It's going to be 100 over pixels from it. It's going to be 60 pixels over from it. Yeah, he hasn't changed the color yet. This is going to be great. CJ always fix positions. Everything. That is a grid all day long.

Oh my god. I'm like fat fingering every single one of these bits of typing here. Uh 150. Okay. First do 100% though I immediately was like, "Oh, I would do a gradient of dude. I could do this in like a actually nice way and I'm not going to. [music] So we'll just have an x of zero and a y of 200 pixels. And uh we'll make it that red color.

You know what I got going on right now is looking a little uh questionable. Not that bad though. And then the last box shadow that we're going to do here. I can't even talk. Okay folks, this is too much too much talking. Okay, let's see that diff baby. Okay, so the width and height are probably wrong.

Oh, um, [music] Scott's getting there. How the heck does a box shadow work? Scott's not going to set the color. It's going to be amazing. Um, why why is there no box shadow? What the heck? Okay, I guess we'll just have another div and then um position it itself in the right spot. [music] What the heck? Scott going to win. Dang it. How's this looking, folks? Is mine smaller? Mine is smaller. So, let's bump up that width.

Make it 140. What is going on with mine? And it needs to be more of a circle. 140 [music] uh margin top is too much. Uh 15 margin top. Am I getting further from Okay, looking a little bit better there. Uh 141 141 2. [music] Um these things are not far enough to the side. They're too far to the side.

25 pixels. Uh [music] 25 pixels. Um okay. I'm not I'm clearly not there. Yeah, I'll just submit now. And [laughter] [snorts] Uh, let's see what what percentage I get cuz my colors are the right colors. Yeah, my face. This is Oh, no. He did he he finally changed the color. Yeah, he finally changed the color. Okay. Or did he?

Oh, I bet CJ's doing some absolute positioning BS. The height does not seem right on these. The [music] height seems like it needs to be 135 or something. 135. [music] Ooh, that's not great either, but it's better. And then left of 131. 32 33 34 32 and a top of 175.

How is mine only 64% match? Is the color not right? Why is the color look so wrong? How did the color get wrong? [laughter] CJ said you have the color wrong. [music] Command S on this bad boy. 99% 99%. He [laughter] Okay, he needs to figure out is he okay on my screen? He's still his his still shows as the wrong color. I don't know. I don't think I'm going to win this cuz uh I cannot figure out the placement of this [music] bottom circle.

The problem is is that the shape of the initial one is kind of wrong and then I'm squishing it with these other two. And then the last one is definitely too [music] tall. So, we're not like perfect here by any means, but we're kind of getting there. So, um doesn't need to be that far down. And then we need to make it wider.

Is my approach of using a box shadow inherently flawed? Because [music] the height has to be dead on, dead nuts on, as Wes would say. Uh, that's what he would say. [snorts] Dead nuts. Yeah, that's how you know something is centered. [music] Let's go. 120 100 90ish.

Theirs is slightly further down. 101, but the it's not further down because the top. So, it's a little bit taller. It's a baller. If [music] wish had a girl, she looked good. that I would call her. Let's go. Width of 210. No, [music] 190.

Go left of 110. Left of 90. This fixed position is definitely killing me. My height is not height enough. Or is my like or is my height too height? My height is too height. Slide view is destroying me here. I'm going in the wrong way. Doing the wrong thing cuz the stupid slide view. Stuck at 99% as always, folks. [music] You know me, Mr.

99%. Okay, that's there. Width goes down to like 190. And then left is 95 99 1 2 3 4. Mine looks like this. Theirs looks like this. Mine looks like this. Theirs looks like that. This is taking a lot longer than I was expecting.

Um, I think to make this easier, I'm going to make that second one a background of [music] red. Okay, so we can see where that is and it's perfectly aligned. If I make mine red, we can see [music] it's pretty effing on. Okay, the issue is that I cannot read this dang diff view. I am so bad at the diff of view.

The diff view just makes me loopy every time. This is like 99.999999999. No. Okay. No, we're waiting for it. 99.9. Okay. 99.9. Dude, I'm gonna have an aneurys.

I'm gonna lose my temper. This is nuts. I could have had this done in like like 12 seconds. Like these guys are amateurs. It's embarrassment. Three circles. Oh, that looks pretty good. That looks pretty good. I know it's not 100, but it's it's good. Give it [music] to me. They're all using box shadow. It has nothing to do with shortcuts.

Why do you hate box shadow? You just put three divs on a page and put them where you want them. They're centered. I feel like I could like jump in right now and still beat these guys. 99.9. We're just going to be battling for the last percentage points. This is crazy. That's close though. 99. Let's get that. Let's get it. So, we can't any outline at all.

Oh, it's cuz he uses fixed positioning every time he does this. Fixed positioning and then never goes 100%. One thing I've learned about these battles is that they do like nice even numbers here. So like is is it 98? Scott, you have to go down. Is it 97? 96.

96 doesn't look that bad, y'all. No, they're like they have to be like a pixel off from each other. Yeah, our top one is way better now. I'm straight up not having a good time. This is stupid. If I had a one pixel blur, would that trick their engine into thinking that I got it right? 99. No, it makes it worse. Okay, our top one is a little bit off when I zoomed out. So, if we do a width of 140, that's it. Come on. Come on. Come on.

Yes. [laughter] That was [ __ ] That was number one [ __ ] Can I just say in the most offensive way possible that both of you were awful at that one? I was good at it. I was finished in like 2 minutes. Three circles and you couldn't get the Why are you using box shadow? because it makes the most amount of sense. Wes, I had that finished in like no time. So, I don't know what you're talking about.

You're just bumping around pixels all day long. Box shadow was not the move. And and fixed positioning. Come on. Yeah, because I had it done, but it wouldn't accept my answer. The very top circle is a width of 140 and a height of 139. And then [music] this bottom is a width of 139.5 and a height of 141. So, that's how that's the only way to get to 100%. And that's why I had to do so much pixel pushing cuz it's not [music] just three. It's not just four circles.

Stupid. [laughter] Well, it was four circles. They're just all different. But they're all different. Yeah. All right. Next up, we [music] have Scott versus Wes. Let's see how they do. Why does it Why do I have the cat? It doesn't look like a cat on my screen. Scott has a less points than me. What a loser. It's a stupid little [music] cat avatar.

Okay. Oh, square with a poop. Okay. [laughter] A square with a poop. That's pretty much what it is. This one looks pretty easy. I mean, I said that about the last one. He was getting so mad about fixed position in garbage. Fixed position D's. It kind of looks like that square [music] is not vertically centered. It kind of looks like there's more on the bottom than the top. I wonder if that's going to mess them up.

Okay. Uh, width, uh, position absolute top 10 px. Okay. I got to put on the diffu here. What the hell does this defue mean? We're going to do background. These are going to be position absolute, folks. Oh my god. Give me some auto completion. Give me some auto completion. Better not [music] have no brothers. All right. Top. Who remembers that? That's an old ass meme.

What am I doing? Oh, it's less. 21 19. Okay, 19. Okay, good. Now [laughter] figuring it out. But 200 px. I'm telling you, this is the way to go for these battles, these fixed position. It's just what you got to do. Yeah, Wes kind of nailed it. 220 right on the dot. All right, let's get on to the poops. X.

Let's just call this one Y and Z. Zed. Sorry, I'm Canadian. Zed. It needs a width. Where Where is this div? Or where's this P? Where'd that P go? It has a width, a height. It has a display block. It has to have a display block. It's a paragraph tag. Let's just duplicate all of this. Okay.

Get them on the page. Where are they? Show up, will you? They both always rip on me for fixed positioning, but I think they're both using fixed positioning right now. So, I think you have to in these battles. I like selecting my attributes, which is what Wes is doing. Is this not updating anymore? What is going on here? Hello. Okay, it is. I can't see anything. Yeah, I'm betting on Wes on this one.

He's He's coming right along. I think he's got it. All he needs is two more ellipses. Put him in the right spot. Done. I guess putting it in the right spot is probably going to be the hardest part, though. Am I going to lose my mind when I see what I'm doing wrong here? Oh, man. Pixel pushing already. 100 left. Zindex. Is it Z-index?

Yeah. So, I can't see Scott's code, but right now all I see is a rectangle on the screen. So, I don't know what his plan is for these uh these ellipses. Where is this P? Where is this div? The height of this one is 91. Oh, look at Wes with the measurement. Let's do 90. Border radius is 50%.

Position absolute. See, Scott's freaking out over there. [laughter] Uh-oh. Scott's got his on there, too. All right. So, now we need to switch to depth. Let's see how Wes positions these. I usually like to try and get the top, middle, exactly positioned, and then I can figure out the width and height from there. Let's see how he does.

This is going to be impossible. I am straight up bad at this right now. What does this diff even mean? I don't understand. Oh, I see. Okay, next one. We're going to do another one of these. Oh, wow. But it's going to be last. Scott, I think, positioned the first one exactly, but he just has the wrong background color, so he might take it.

This is a lot harder. I apologize for everything I said in the last one. Uh, 30 -40. Uh, change it to the green color. Submit. Scott submitting. Let's see what he gets. If I get 99%, I'm going to lose my mind here. Looks like he's going to lose his [laughter] Now it's just pixel pushing at this point. How is Scott at 99% already? Ah, I feel like I could like jump in right now and still beat these guys.

Still beat these guys. Okay, I got I'm panicking. I swear there's something wrong with my browser rendering engine, guys. My guess is that these two ellipses are not not the same. Okay. Oh man, this is what those guys are those guys are having. The problem is just the diff is impossible. Where am I at right now?

Oh, I'm at 99% too. A screw Scott. Yeah, Wes has 99.1, but that's really just cuz the diff is decent. He only has a single oops on the screen right now. I can't even tell what's going wrong on mine right now. Well, Scott's putting his red, too. Wes is on the right track. It's a matter of getting these in the right height and width cuz the diff is ever so different.

There's no difference there. I'm on Chrome, folks. Am I wrong? Like what the ever am I wrong here? What is going on?

[screaming] This guy got it. [laughter] Damn. Nice. That was way harder than I thought. Yeah. Now, now you see what we were dealing with, Wes. Yeah. Holy. You have to go fix position and then it's just pixel pushing. Like there's really no way to even try to There's too many variables. Wait, that was hard.

How'd you get 100% on my screen? Your ellipses don't touch the edge. Uh I think I I when I pounded my computer, uh it accidentally deleted it. Changed the code. So this is what my code ended up being was. All right, [music] we got a heavyweight battle here. There is no cat avatars in this one. We got CJ versus West. Let's do it.

All right, more pixel pushing. Let's see what we get. He's just going to fix position everything. This better not be a stupid circles one again. Give me something real. Give me a button. Give me something good. Oh, more circles. Good. Okay. Whoa. Okay. This is going to be tricky. Okay. Uh let's set the background to that blue color. [music] Um let's set margin of everything to zero.

That. Okay. And then we'll grab this blue circle with the X background. No, that's is that it? Yeah, I did something here. There he goes. He he didn't style with an attribute. Why did I This happened last time, too. There we go. It's a good choice to get going with the attribute so you don't have to change [music] that later.

This does look perfectly centered. So, I think I am going to make the body a flexbox with justify content center and align item center. And then we'll just get the width and the height exactly right. I'm thinking like 300 by 300. That's too much. 200 by 200. DJ's already put his in the middle. Um, [music] and you don't need to do this with position absolute. In fact, that's probably the wrong call on Wes's [music] part.

Man, the diff is really going to get me. This might not be perfectly centered. This is crazy. Do the old differi 60 70. Oh, 55. Oh, close left. All right, we got the square there, but I have a feeling it's not perfectly in the center. But let's see. And then we'll just need one more element. Oh, how is CJ there already? Holy [ __ ] G is managing to make the process of centering a square one [music] of the most difficult challenges.

What is it? Is it too much or not enough? I don't understand this diff view. It's not enough. Oh, that's too much. Make it fixed position and we'll give it a border radius 50%. 100%. And this needs to be drawn underneath the div. So, I'm going to draw it first. So we are several minutes into this and Wes has finally gotten a blue square [music] in the center of the screen.

So div circle 1 2 3 4 5 [music] 6. So our circle is width 100 px. Ah I need the yellow. Give me the yellow. Shouldn't that appear underneath? I guess we'll just do zindex. Okay. So z-index of negative 1.

height 50px background [music] border radius 50%. Okay, we have to do position absolute. Oh, look at him. He's got so many. Okay. [laughter] Um, left 10x 60. That looks good.

20 30 40 50 60 70ish left 50ish. [music] Okay. And then if we give it a z-index of maybe maybe if we give a z-index of one of the the square. There we go. I set them both to zero. Oh, freaking nailed it. Okay. So, now I just need to change every single one of these. Um, you know what I'm going to do? I'm going to make variables.

Wes is choosing to use variables here, which top [music] 60 px. Can anybody explain to me why this is got to move fast? He could have just done it with inline styles, [music] folks, cuz now he's just going to be doing multiples and whatever. Yeah, he's doing math. Just going to go back to what I had cuz it was like almost perfectly aligned. All right, we're going to go with that and then just repeat it a bunch and see if it's in the right spot. I mean, I guess I'll submit now cuz that looks almost perfect. But we will add a box box shadow 125 24 125. Oh, they're not lining up. Okay, good. Um, then this one would be 255.

No, 220, 212, 200, 190. Good. Got it. Okay. 25 65. 65 is perfect. And then we need another one at 65 * 2 is 130. Perfect. [music] Uh, we'll do the exact same thing for both of those, but we need to position just the X on the first one. Where are they going? 100. You know what? Take this Z-index off for [music] a second. 250.

Guys, I cannot believe that they are taking this long to put circles in. You know what would have been a better solution to this is the same solution [music] that these guys always give me [ __ ] for is box shadow would have taken care of this like that. You don't need extra elements. You don't worry about positioning [music] them. Box shadow, baby. Oh, this is going to come down to the wire, folks.

Wes has got one more to move. CJ's not there. I don't know if this is going to work, right? Cuz you can we can see the slight outline there, but [music] let's give it a try. 99.9 is my guess. If not, I'll be pleasantly pleasantly surprised. Index and Z index 86.

How is that possible? It's pretty much bang on. It's not bang on. It's not even close. He's got to do Zindex. Oh, it's I forgot my Z-index, obviously. Diff [music] submit. I feel like I'm going to have be pushing half pixels here and there. 99.9. No. [laughter] Uh I think it all comes back to the height of his Why is there the height of his yellows is just ever so slightly mine.

He gets one more pixel on those yellows. And I think he is there. Height and width needs to be a bit more. 191.5. He's choosing to add to the height of the square. Width the square. No, that Oh my god. Wes wrong one.

He's on the wrong element entirely. He sees it. He knows it's the height of this. Yeah, depending on the zoom level, like you don't even see the outline. This is crazy. Okay. Um, let's adjust the top 59. And that looks pretty good. Try this. Yes. [screaming] Okay. [laughter] Oh my god, Wes. You had it. I don't know what happened to you, man.

Like, I had it. Like, it was good, wasn't it? Yeah, you had it. The height of the yellows in the position just wasn't quite right and then by the time you started tweaking it. So, that last move where I tried to bump it all up half a pixel. You think that would have done it? I think you needed to bump it down half a pixel or up. I'm not sure. One of the two. Yeah. Did you use box shadow or what' you use? Oh, you just have a bunch of bunch of divs. Okay.

Oh, it was a half a pixel. It seemed like you were both going really slow, but maybe it's just from the perspective of uh It is. It's It's painful to watch other people do it because it seems so easy, but it's stressful. And the music is like Oh, I turned the music off. I turned the music off. Yeah, it's Wow, that was that was a crazy one.

And I am the undefeated champ. [laughter] Well, I have I have two. Good job, CJ. You're good at making circles. But that was super fun. Beautiful. Thank you so much for watching. Uh, if you enjoyed this, let us know down in the comments who you think really won. And we'll catch you in the next one. [laughter]

Quote it with credit and a link. Quoting Syntax