ฝึกพูดภาษาอังกฤษด้วยเทคนิค Shadowing จากวิดีโอ: Your AI broke the layout. Now what?

กำลังสร้างบทเรียน...
1
The most undervalued skill in front-end development right now has nothing to do with prompting, but instead it has to do with identifying and fixing problems,
2
because every now and then AI is going to get things wrong.
3
Now this doesn't happen every time you prompt something, and it's not that all of the errors are catastrophic, though that definitely can happen from time to time,
4
but when these problems do come up there's two kinds of developers that are out there.
5
There's those that can identify the problem in under a minute and go ahead and fix it relatively quickly, And there's others who spend half an hour reprompting the AI trying to understand what's wrong with it
6
and trying to get it to fix the problem that it created in the first place.
7
And being a CSS person, I see this happen with CSS a lot.
8
So we're going to dive in
9
and look at some of the things you can do with CSS to be able to solve the problems
10
that come up and the types of things you want to be looking at and identifying when things happen.
11
And this is actually a challenge that is in my course, CSS Demystify, that we're going to look at and do together where this is what we want.
12
And there's some problems right now.
13
And so let's jump to full screen mode here and I'm just gonna make the font size bigger.
14
So, you know, for recording purposes, you guys can see what's going on and everything looks okay.
15
In terms of the markup, I don't see anything that would be catastrophically problematic there.
16
But when it comes to CSS layout issues, it's really useful to be able to quickly look at things and go red flag right away.
17
This is a very simple example of the types of things that you might be looking for.
18
But we have like our text is too close to the top over here.
19
We obviously have some overflow, which is the easiest problem.
20
And there's a few other smaller things here that can easily pop up.
21
So the very first thing is just fixed widths and heights.
22
Now, LLMs generally don't do this these days, but it is still one of those things that we want to avoid at all costs.
23
And I always say, if you're going to be setting a size on something, you don't want to set a fixed size, you want to set a constraint.
24
So I'm going to set a max width here.
25
And that means, you know, I'm actually able to get smaller than that.
26
And we can see here it's shrinking and growing instead of being locked in at that size.
27
And for a height, again, you could set a constraint if you need the constraint, it would be a min height, which means like if this was bigger,
28
then it would be able to be bigger.
29
And so like most of the time, height is actually a useless declaration.
30
And this isn't the type of useless declaration that an LLM will generally make.
31
It's usually a person will throw that on there.
32
But if we don't set a height, height auto works.
33
It's fantastic.
34
It works with how the browser wants to work as the content has different amounts of space.
35
It can adjust and grow and shrink and do what it needs to do.
36
But the types of useless declarations that LLMs do do every now
37
and then actually does sneak its head and is what's causing the overflow over here.
38
And if I come and take a look, there's a width 100% right here.
39
And this is what the issue is.
40
And if we take this off, you're going to see it fixes itself.
41
Nice, right?
42
Some eagle-eyed people watching this might be going, Kevin, that wasn't the problem.
43
The problem was that you never declared a box sizing border box, but that's not correct.
44
Even if I put that, let's do it really quickly here, it's going to do a border, not border, box sizing of a border box on here.
45
It's fixed it a little bit, but it's still not completely there.
46
And the reason for that is box sizing border box with 100% plus margin, margins are outside of your border box.
47
It's not included in there.
48
Just like height, a lot of the time the auto works fine.
49
Same thing here.
50
The width of auto works fantastically well, and I don't actually need to declare it width there.
51
So we can get rid of that one.
52
Our layout is almost there.
53
We have the major issue I would say right now is, do I even want margin on here?
54
When you have an element inside, you generally don't want to put margins outside.
55
And this is the type of thing that can sneak in sometimes
56
because you're focused on the one thing that you're writing code for and you go, I need space all around it.
57
But this would probably make more sense if I took this margin off completely to begin with, which now I guess that width 100% wouldn't be an issue if you did have your box sizing.
58
But then coming all the way back up to my card, I would replace that with this padding of the 24 pixels here, which adds it all around.
59
And anytime you need more background, we want to come in with some padding.
60
So quick things that we can identify there.
61
And now the main issue is we have extra space here.
62
We had weird spacing.
63
We still have weird spacing there.
64
And the spacing down here at the bottom is also getting kind of weird as well.
65
Once again, margins start rearing their ugly head.
66
We had collapsing margins going on.
67
Now we actually have extra margins happening.
68
So here on the title where I had this margin top because I needed some extra space that wasn't actually doing anything.
69
I can remove that.
70
And not only can I remove it, I actually want to say that the margin top is zero.
71
We can have a CSS reset here that's getting rid of all of our margins.
72
That would probably be a little bit more standard, but we can see we got rid of that weird space at the top there.
73
And then here I would probably want to come down on the content.
74
And it's not even on the content, it's coming from the paragraph here.
75
So maybe my content, you know, this is where maybe you actually have a star of a margin of zero, and then that gets rid of all of the spacing.
76
And then here we can do a display grid
77
and then a gap of whatever space that we want to have to replace the margin with gaps.
78
There's a few different strategies here.
79
I'm not always a fan of this specific one.
80
There's other ones that I do like.
81
And of course, this is all part of my course, CSS Demystified, where I talk a lot about this.
82
This is part of my Making Sense of Layouts module that's here right now.
83
We have strategies with dealing with margins, which is all about bringing in the different amounts of space, coming in with grid, creating structured ones when we want to do a flex box with grid, all the different things like this.
84
And the whole point of the course is to understand CSS better.
85
This specific module about layouts.
86
I'm doing a new module right now called Writing Resilient CSS
87
which is all about writing CSS that can scale and be maintainable.
88
And it's all about getting you to understand CSS better.
89
So whether you're writing it yourself and you just want to be more efficient and not be fighting with the CSS,
90
or if you are using an LLM or some other AI tool to write CSS for you and other front end stuff, but every now and then there are problems that come up or things to debug,
91
you'll be able to identify the problems easily, quickly, and fix them while you're at it.
92
So if you're interested in that, the link is down below.
93
And with that, I want to say a very big thank you to my enabler of awesome, Johnny, as well as all my other patrons and channel members for their continued support.
94
And of course, until next time, don't forget to make your corner of the internet just a little bit more awesome.

สิ่งที่คุณจะได้เรียนรู้

ในวิดีโอนี้คุณจะได้เรียนรู้ทักษะที่สำคัญเกี่ยวกับการพัฒนาเว็บไซต์และการแก้ไขปัญหา โดยเฉพาะเมื่อใช้ CSS ทักษะที่คุณจะได้พัฒนาประกอบไปด้วย:

  • การระบุปัญหาที่เกิดขึ้นในโครงร่าง CSS
  • วิธีการปรับขนาดและความสูงขององค์ประกอบให้เหมาะสม
  • การเข้าใจการทำงานของ box-sizing และการสร้าง layout ที่มีประสิทธิภาพ

ฟังเสียงเหล่านี้

เมื่อคุณฝึกฟังการสนทนาในวิดีโอ คุณจะได้ยินการเชื่อมเสียงและการลดเสียงที่เป็นเอกลักษณ์ การฟังเสียงเชื่อม (linking) เหล่านี้จะช่วยให้คุณเข้าใจการพูดของเจ้าของภาษาได้ดียิ่งขึ้น ตัวอย่างเช่น:

  • การเชื่อมเสียงระหว่างคำที่ทำให้การพูดดูราบรื่นยิ่งขึ้น
  • การลดเสียงในคำบางคำที่ช่วยให้การสื่อสารเร็วขึ้น

การฝึกฟังเสียงแบบนี้จะช่วยให้คุณ ปรับปรุงการออกเสียงภาษาอังกฤษ ของคุณได้อย่างมีประสิทธิภาพ

พูดเหมือนเจ้าของภาษา

เพื่อให้การพูดของคุณมีความเหมือนเจ้าของภาษา คุณควรฝึกในการเลียนแบบจังหวะและน้ำเสียงที่พูดในวิดีโอ คุณสามารถใช้เทคนิค ชาโดว์อิ้งภาษาอังกฤษ ด้วยการฟังแล้วพูดตามเสียงของผู้พูด นี่คือวิธีการที่ช่วยให้คุณ:

  • พัฒนาความมั่นใจในการพูดภาษาอังกฤษ
  • ปรับจังหวะและอารมณ์ในการออกเสียงให้ตรงกับเจ้าของภาษา
  • พัฒนาความสามารถในการฟังและพูดในสถานการณ์จริง

การฝึกด้วยวิธีนี้จะช่วยให้คุณ ฝึกพูดภาษาอังกฤษ ได้ดียิ่งขึ้น และทำให้การสื่อสารของคุณมีความคล่องแคล่วและเป็นธรรมชาติมากขึ้น

ไวยากรณ์ในวิดีโอนี้

โครงสร้างที่ผู้พูดใช้บ่อยที่สุด พร้อมคำพูดจริงจากวิดีโอ:

โครงสร้างในวิดีโอ
Relative clauses who / which + อนุประโยค — ข้อมูลเพิ่มเติมเกี่ยวกับคนหรือสิ่งของoverflow, which is · height, which means · margins, which is
Passive voice be + กริยาช่อง 3 — เน้นสิ่งที่เกิดขึ้น ไม่ใช่ผู้กระทำis just fixed · being locked

เทคนิค Shadowing คืออะไร?

Shadowing เป็นเทคนิคการเรียนรู้ภาษาที่ได้รับการรับรองทางวิทยาศาสตร์ พัฒนาขึ้นสำหรับการฝึกนักแปลมืออาชีพ วิธีการนี้เรียบง่ายแต่ทรงพลัง: คุณฟังเสียงภาษาอังกฤษจากเจ้าของภาษาและพูดตามทันที — เหมือนเงาที่ตามผู้พูดด้วยช่วงเวลาห่าง 1-2 วินาที การวิจัยแสดงว่าเทคนิคนี้ปรับปรุงความแม่นยำในการออกเสียง ทำนองเสียง จังหวะ การเชื่อมเสียง การฟังเข้าใจ และความคล่องแคล่วในการพูดได้อย่างมีนัยสำคัญ

เทคนิค shadowing: อ่านคู่มือฉบับเต็มทีละขั้นตอน →