How To Get The Perfect Spacing In Web Design — Transcript
Full transcript
- 0:00[Music]
- 0:02hi guys welcome back to the channel
- 0:04today we're going to be talking about
- 0:05spacing elements in web design
- 0:07specifically
- 0:09I'm going to show you the simple rules
- 0:11we do here and how you can get your
- 0:13websites to feel natural smooth with
- 0:16great hierarchy and the main benefits of
- 0:19this is number one it's going to be
- 0:21great for the user to have recognizable
- 0:23patterns they're going to understand
- 0:24what content belongs to what elements
- 0:27how it's all grouped together they don't
- 0:29even need to think about it and second
- 0:31is that it's going to be much easier for
- 0:32your developer
- 0:34build this right we'll get into that so
- 0:37the first thing we need to be aware of
- 0:38is the ux law of proximity so if we have
- 0:41a look at this website here laws of
- 0:43ux.com and I'll leave a link to this
- 0:45page in the video description
- 0:47let's look at the law of proximity I
- 0:49think this is the bare minimum you need
- 0:51to understand in order to get a website
- 0:52to sing so it states that objects that
- 0:55are near or proximate to each other tend
- 0:57to be groups together
- 0:59makes sense key takeaways being
- 1:02proximity helps to establish
- 1:03relationship with nearby objects
- 1:05elements in close proximity are
- 1:08perceived to share similar functionality
- 1:09or traits and proximity helps users
- 1:12understand and organize information
- 1:13faster and more efficiently this is
- 1:17really important people don't spend a
- 1:19long time on websites it's our job to
- 1:22make it as easy as possible for them to
- 1:24scan and digest the content let's have a
- 1:26quick look at this example that they've
- 1:27included which is really helpful which
- 1:29shows a Google search result and we know
- 1:32everyone knows this right this is one
- 1:34result here at the top this is the next
- 1:36result this is the next result we can
- 1:38scan this without even thinking and we
- 1:40know that and that is all to do with the
- 1:42spacing of these elements so each sort
- 1:45of card has or each result which I would
- 1:47call the card has a maybe four or eight
- 1:50pixels space between each and then
- 1:52between the that result and the
- 1:54following result there's maybe about 40
- 1:56or 56 pixels Gap there
- 1:59so we can see groups content together
- 2:00and then the next group of content and
- 2:02then the next group of content and
- 2:04that's all it is so this is the law of
- 2:06proximity study that one up have a look
- 2:09at the rest of this website it's a
- 2:10fantastic resource and you should read
- 2:12all of these there's also a great book
- 2:13and I'll leave a link to that in the
- 2:15description so let's have a look at this
- 2:17design now with that in mind we can
- 2:19obviously see that these three elements
- 2:22as part of the hero design are grouped
- 2:23closer than they are then the space
- 2:26above and below so you can see we've got
- 2:28120 pixels padding top and bottom and
- 2:30then between these elements we've got 32
- 2:32pixels and then the button group we've
- 2:34got 12 to show that they are their own
- 2:36separate subgroup
- 2:38so where do you get these numbers from I
- 2:41hear you ask well let's have a look over
- 2:43at our handy spacing sizes cheat sheet
- 2:45over here
- 2:46and just a few notes here to kind of try
- 2:49and explain this to you so first thing
- 2:51we want to contain the information we
- 2:54don't want the information spreading all
- 2:55the way to the sides of the website we
- 2:57need some space we need some breathing
- 2:59room around everything 1200 pixels is a
- 3:02good place to start from container a lot
- 3:04of people do 1280 some people go down as
- 3:07low as sort of 960 ish which I feel is a
- 3:10bit dated and everything's a bit too
- 3:11narrow and squashed I always like to
- 3:13start 1200 and when we're designing we
- 3:15set this up on 40 40 width artboard
- 3:19and then we want to think about padding
- 3:21between sections we typically use three
- 3:23different sizes of padding between
- 3:24sections and these will always be
- 3:27divisible by eight which we'll get into
- 3:28in a moment so maybe you'd have you know
- 3:30your large padding in 44 your medium is
- 3:3480 and your small is 40. that's just you
- 3:37know obviously each design is different
- 3:40that's just a good place to start
- 3:42this is going to ensure consistency we
- 3:45don't want all sections to have
- 3:46different amount of padding it's nothing
- 3:48worse than from a developer's point of
- 3:50view when he opens up a design and sees
- 3:5267.5 pixels at the top and 158 at the
- 3:56bottom here that means he's going to set
- 3:58up a separate class for the top and the
- 4:00bottom spacing and then the next section
- 4:02is different so he's like oh goodness he
- 4:04or she sorry and they're going to have
- 4:06to do a different class for the next bit
- 4:08and then a different class for the next
- 4:09one because they should be able to look
- 4:11at your design create all of their
- 4:12Styles before to make their job easy and
- 4:15official which saves money for the
- 4:18client right everybody's happy so this
- 4:21is all by using what's known as a four
- 4:23or eight pixel grid
- 4:25hopefully you've heard of that before
- 4:26and the reason we do this is just that
- 4:29everybody uses it it's really easy
- 4:32um to work out the spacing system just
- 4:34works really well on the eyes it's easy
- 4:36to digest and the reason why I say four
- 4:38or eight is a lot of people call it four
- 4:40but if we laid out all of our spacing
- 4:43and if we did this in increments of four
- 4:45you'd end up with hundreds and hundreds
- 4:46of different options you might be a bit
- 4:48overwhelmed and you don't really need
- 4:49them so we use
- 4:51um four pixels up until 20. so a lot of
- 4:55the times with space elements four
- 4:56pixels between each other like in a
- 4:58little card or a little small print text
- 5:00and stuff like that sometimes 8 12 is
- 5:02great 16 is Lush 20 Pretty Good Nice
- 5:06Slice of a checkbox and then we get to
- 5:0824 and that's obviously divisible by
- 5:10eight and then we start jumping up by
- 5:11eights so if for example you laid
- 5:13something out with 24 pixels between
- 5:15each three all of the three elements in
- 5:18your group and it didn't quite feel
- 5:20right you've just jumped up to 32 you
- 5:22don't need to go to 28 or 29 just stick
- 5:25to this eight pixel grid so these few
- 5:28Simple Rules can help you and you can
- 5:30also have a think about container sizes
- 5:32so how we have padding between sections
- 5:33we've got three sizes here you can have
- 5:35three container sizes as well you can
- 5:37have a large a medium and a small
- 5:40all of that is just going to help your
- 5:42design
- 5:43flow really well so let's have a look at
- 5:45the example and break it down
- 5:48so if we turn our grids on we can see
- 5:50that we've got a 12 column grid set up
- 5:52there are 32 pixels between each of the
- 5:5512 columns
- 5:56the 4x8 as we've already gone over 120
- 6:00top and bottom so that's our sort of
- 6:02large spacing for a section that we've
- 6:04decided here and inside this hero we've
- 6:06got 32 between each great so we're in
- 6:09bite we're adhering to the law of
- 6:11proximity straight away we then have
- 6:14this image which is set in a little bit
- 6:16so this is only spanning 10 columns
- 6:18instead of 12 and we might say hey
- 6:21developer this is what our container
- 6:23medium is it's going to be this big
- 6:26then we have our next section so we can
- 6:28see here we've got essentially three
- 6:31rows of content so we've got two rows in
- 6:33this grid and the title here so we've
- 6:36got 56 pixels between that we've got 56
- 6:39pixels between that this means that the
- 6:42developer is going to just create one
- 6:43Grid it's going to have 56 pixel space
- 6:45between and then each of the columns is
- 6:49going to have 32 pixel space between
- 6:51really easy right so what we want to
- 6:53think as designers is next time we're
- 6:55making a grid or a section that needs a
- 6:57headline and a grid or just three
- 6:59columns let's do the same thing right
- 7:01let's have 56 pixels between the title
- 7:03and the grid let's have 32 pixels
- 7:06between the cards that way the developer
- 7:08only has to code this once they can then
- 7:10copy and paste that code and another
- 7:12great benefit
- 7:13is that it's recognizable for the user
- 7:17right they they've already seen this
- 7:19they don't want to then be hit by a 25
- 7:21column what the hell's going on here
- 7:24they've already recognized this pattern
- 7:25they see it again and the third major
- 7:27benefit here is that it's going to keep
- 7:29the CSS as light as possible which is
- 7:31what we want to do when we're developing
- 7:33websites the game is to make it as
- 7:35efficient and clean as possible if this
- 7:38if this had you know 100 pixels between
- 7:41here and 90 between here it's going to
- 7:44be a lot more difficult to code you're
- 7:45going to have to write a lot more code
- 7:47to get that spacing to work and it's
- 7:49going to clutter the CSS file so again
- 7:52here next section 120 120
- 7:56and then here we'll come back to this in
- 7:58a second sometimes you can break out
- 8:00this grid that's okay a lot of people
- 8:03think oh my goodness what on Earth are
- 8:05you doing no one's going to come in and
- 8:07measure your designs right we just want
- 8:09to be
- 8:10we have to find that balance between
- 8:12adhering to the rules using the ux laws
- 8:15which are all based in Psychology and
- 8:18being creative sometimes if you're too
- 8:20limited you can't your creativity can't
- 8:22work so sometimes you could break out
- 8:24that's okay and I'll show you how we set
- 8:26this up and why in a moment and here we
- 8:28go another example we've got a three
- 8:30column grid let's have a look 32 pixels
- 8:33between each element so this is the
- 8:35exact same grid as above just the card
- 8:38content inside is styled slightly
- 8:40differently and that's fine because we
- 8:41need to put in some Creative Flair here
- 8:43and there 120 top 120 bottom perfect
- 8:47it's the last thing to talk about let's
- 8:49just quickly have a look at this and put
- 8:50our guides on oh my god look that is
- 8:53like a third over this column oh don't
- 8:56open Slack
- 8:57this is coming to here what on Earth is
- 9:00going on actually in the design it
- 9:02should be like this and I'll tell you
- 9:03why right let's have a look looks good
- 9:06feels natural
- 9:08fine let's have a look if we adhered to
- 9:11the rules right let's put this image
- 9:13here so it's only spanning the six
- 9:15columns exactly and let's turn our UI
- 9:18back on
- 9:21the space between 32 and that's off have
- 9:24a look
- 9:25it was really cluttered doesn't it it's
- 9:27too close and especially because this
- 9:29image here on the left has got loads of
- 9:31space in it the whole theme of this
- 9:33design here is about space we need space
- 9:36right so I'm going to whack that back up
- 9:39to 80. 80 is still divisible by hey I'm
- 9:42cool with that
- 9:43let's have a look at this it's this
- 9:46spans six columns right this image the
- 9:49reason I had it set here before is that
- 9:51this is then 50 of the container width
- 9:54this means the coding is really easy and
- 9:56we can reuse this quite simply across
- 9:58the site we can just have a class called
- 10:00image 50 and it literally fills up 50 of
- 10:04its parent we can just reuse that that's
- 10:06fine no one is going to go and measure
- 10:08and go oh my goodness you haven't
- 10:10allowed for the gutter between the
- 10:12columns
- 10:13this doesn't line up let's make it line
- 10:15up and have a look what happens
- 10:17uh civil just increase the padding here
- 10:22now it's working as part of the grid
- 10:24let's have a look
- 10:27too far away now they don't feel like
- 10:29they're connected it feels like we've
- 10:30got a floating image on one side some
- 10:32floating text on the other side and the
- 10:34Gap is too big that your eyes kind of
- 10:36don't know where to look they're trying
- 10:37to look out at the same time
- 10:40so that's why I say it's okay to break
- 10:43it so what you would do is you'd
- 10:45probably start
- 10:47and that's for 32 pixels between and you
- 10:49go yeah that's what I'm supposed to do
- 10:51doesn't quite look right and then if you
- 10:52put your cursor in here hold shift and
- 10:54press up on your keyboard it's just
- 10:57going to bump it up in increments of
- 10:58eight so let's bump it up until it feels
- 11:01good 64 looks good I'm happy with that
- 11:04but I'd keep it at 80 very happy with
- 11:0680.
- 11:07that works it's no problem sometimes
- 11:09that's fine okay just don't go crazy
- 11:12with it so I'm hoping that this video
- 11:15helps
- 11:16might be a good idea to take a
- 11:18screenshot of this if I keep that on
- 11:20there for you so you've got some sizes
- 11:22to work with but just remember it's all
- 11:25about consistency
- 11:27space and hierarchy if you don't know
- 11:30how to create good hierarchy in your
- 11:32designs the easiest way is to get your
- 11:35design to work just with the typography
- 11:37just having a really clear set of rules
- 11:39around your typography and if you're
- 11:41looking for a video on how to do that
- 11:43we'll leave one at the end of this video
- 11:44for you I hope you got something useful
- 11:47out of this if you did give us a thumbs
- 11:49up and if you've got any comments let us
- 11:51know down there we're always around and
- 11:53we will see you in the next video thanks
- 12:04[Music]
- 12:06foreign
- 12:08[Music]
About this transcript
This page contains the full transcript of How To Get The Perfect Spacing In Web Design by Tonic, generated from the public captions YouTube serves with the video. The transcript has 2,359 words across 329 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.