Layout & Design

Absolute Positioning in Framer (Fundamentals Lesson 5)

Absolute Positioning in Framer (Fundamentals Lesson 5)

Absolute Positioning in Framer (Fundamentals Lesson 5)

Joseph

·

7:40

·

79K views

·

About this lesson

The beautiful thing about Absolute positioning for us visual designers is that we get to drag things around and position them in a super freeform way — just like working in the design tools we know and love.

But when it comes to building well-structured, responsive websites, there’s a bit more to it — so let’s take a deeper look at the ins and outs of Absolute positioning, what it can do for us, and when it makes the most sense to use.

https://www.youtube.com/watch?v=h_ejFUqkLXQ&t=0s Intro

https://www.youtube.com/watch?v=h_ejFUqkLXQ&t=4s Overview of layer position types

https://www.youtube.com/watch?v=h_ejFUqkLXQ&t=13s Understanding absolute positioning

https://www.youtube.com/watch?v=h_ejFUqkLXQ&t=29s Pinning and setting position in Framer

https://www.youtube.com/watch?v=h_ejFUqkLXQ&t=43s Centering vs stretching with pinning

https://www.youtube.com/watch?v=h_ejFUqkLXQ&t=67s How pinning affects resizing

https://www.youtube.com/watch?v=h_ejFUqkLXQ&t=113s Stacks vs absolute positioning

https://www.youtube.com/watch?v=h_ejFUqkLXQ&t=154s Switching a layer from relative to absolute

https://www.youtube.com/watch?v=h_ejFUqkLXQ&t=190s Understanding Z index

https://www.youtube.com/watch?v=h_ejFUqkLXQ&t=218s Wrap up

🌞 Start for free: https://framer.link/yt

📚 Learn more at: https://framer.link/yt-academy

💎 Join the Community: https://framer.link/yt-community

🎉 Follow on X: https://framer.link/yt-x

0:00the beautiful thing about absolute0:01positioning for us visual designers is0:03that we get to drag things around and0:05position them in a super free form way0:07just like working in the design tools we0:09know and love but when it comes to0:11building well-structured responsive0:13websites there's a bit more to it so0:16let's take a deeper look at the ins and0:18outs of absolute positioning what it can0:20do for us and when it makes the most0:22sense to0:24[Music]0:25use since this is the first of several0:28lessons on layer positioning I want to0:29start start with an extreme0:31simplification of the four layer0:33position types we have absolute where we0:36can freely position layers in relation0:38to their parent frame relative where the0:41position is determined by the flow of0:43content in a stack or grid fixed where0:47the position of a layer is fixed0:48relative to the0:49viewport and sticky where a layer0:52switches from relative to fixed when it0:55hits the top of the viewport then back0:57to relative when it hits the bottom of0:59its parent frame1:00I know that's already a lot to take in1:01but none of it needs to make sense just1:04yet we're going to start slow and focus1:06on absolute positioning for this lesson1:10you can think of absolute position1:11layers as floating in the sense that we1:14can move them around with complete1:16disregard for other sibling layers and1:18just focus on where the layer is in1:20relation to its parent frame just like1:22figma and sketch it's our default when1:25creating new projects and pages so1:26you'll feel right at home the one thing1:28that may differ slightly from screen1:30design tools is how we Define the1:32position of these layers rather than the1:35layer having just an X and Y position1:37that's always measured from the top left1:38corner like sketch and figma framer1:41gives us a super inuitive combination of1:44pinning and describing position which is1:46how things work on the web with HTML and1:49CSS let's take a look at how it works1:51with a super simplified example here I1:54have this long black frame with an1:56absolute position near the top of this1:58desktop breakpoint which is the parent2:00element it's positioned within before we2:03even look at the properties panel let's2:05get philosophical for a moment there are2:07a few different ways that a human being2:09could describe the position of this2:11Frame you could say it's horizontally2:13centered you could say it's 20 pixels2:16from the left or you could say it's 202:17pixels from the right or both you could2:20say it's 20 pixels from the top or you2:23could say it's 500 pixels from the2:25bottom all of these things are true but2:27not all of these facts are equally2:29important2:30for example who cares that this is 5002:32pixels from the bottom it just so2:34happens to be 500 pixels from the bottom2:36but that doesn't mean it's a deliberate2:38design decision so let's look at the2:40properties panel here we can see all2:43those values describing how far the top2:45of the layer is from the top of its2:46parent frame how far the left is from2:49the left the right is from the right and2:51the bottom is from the bottom you'll2:53notice some of these values are solid2:55and some are great out a solid value2:58means a value that's EXP explicitly set3:01which also means it's a relationship3:02with the parent frame that we want to3:04maintain in this case we're saying that3:06this 20 pixels is no accident we want3:09the top of this Frame to be 20 pixels3:11from the top of the parent frame now and3:13if the parent changes size in other3:15words pinning a side means we want to3:17maintain a fixed amount of space where3:20having a side unpinned means we don't3:21mind if that space changes this is that3:24combination of pinning and setting3:26position that I mentioned a moment ago3:28we can pin aside by either explicitly3:30setting a value or by clicking the3:33pinning controls to toggle them clicking3:36on the middle will also toggle between3:38pinning all four sides or none of them3:41which will position relative to the3:42center I'll go back to pinning just the3:45top but for the sides we actually have3:47an important decision to make here if we3:49leave both sides unpinned the rectangle3:52will stay centered sure but since the3:55rectangle has a fixed pixel width it'll3:57stay the same width as the parent3:59changes size sometimes that is what we4:02want but for the sake of comparison4:04let's pin those 20 pixel4:06values and now we can see that the4:08rectangle maintains those pixel margins4:11by getting stretched and squashed by the4:13parent frame automatically another thing4:15worth noting is that pinning doesn't4:17only affect what happens when the parent4:19frame changes size but also if we change4:22the size of a child layer on the4:24properties panel for example I'll pin4:26the rectangle to the top right then4:29change the width of the rectangle to 1004:32pixels That explicit 20 pixel Gap to the4:34right Edge is maintained so I don't need4:37to worry about resizing then4:39repositioning in two separate steps it's4:42important to note that the choices we4:43make here affect how things move and4:45resize on the design canvas as well as4:47in the browser on the published site so4:50making good choices is also a stride4:53toward making our sites properly4:55responsive in the next lesson we're4:57going to dive into stacks and relative4:59positioning but in case you've already5:00come across a stack I want you to be5:02prepared for how they behave when5:04absolute positioned layers get mixed in5:07in this example I have a frame with a5:09vertical stack layout which means each5:11of the child layers set to relative5:13positioning will follow the flow of the5:15stack so dragging simply rearranges the5:18layers within the flow I'm not free to5:21position things the way I was with5:22absolute positioning but just because a5:24layer like this graphic is a child of a5:26stack doesn't mean I can't head over to5:28the properties panel and switch it from5:31relative to Absolute you'll notice5:34things collapsed a bit here on the5:35canvas so what just happened well5:38switching a layer from relative5:39positioning to Absolute positioning5:41effectively removes it from the flow of5:44the stack it's still a child of the5:46stack frame but its sibling layers still5:49set to relative only push against one5:51another ignoring absolute position5:54layers and just as we'd hoped we can now5:57drag our absolute layer to position it5:59wh ever we'd like you'll also notice6:02that this layer is visually overlapping6:03its siblings but on the layers panel6:06it's actually not the layer on top so6:09what the heck it's because of a style6:11property called zindex that was added6:14automatically when we made the switch6:16from relative to Absolute positioning a6:17moment ago using zendex we can pull6:20things forward on top of everything else6:23or push things back behind everything6:25else regardless of where it happens to6:27be in the layer hierarchy the higher the6:29number the further forward the lower the6:31number the further backward and for6:34layers that share the same zindex the6:36layer hierarchy will determine which is6:39above and what's below like usual the6:42default zindex for layers is zero which6:44means a z index of one already puts this6:46graphic above everything zero puts it on6:49the same plane and negative 1 puts it6:52back behind everything you might be6:54thinking I didn't ask for zindex to get6:57involved here but it's worth noting that6:59with stacks the layer order first and7:01foremost determines the flow of the7:03content so thanks to the Zandex property7:06we can separately control how things7:09overlap all right this was a big one a7:12really big one we're finally unpacking7:14the fundamental layout mechanics that7:16make framer so powerful this stuff is7:19easy to fiddle with but it does take7:21time to master watch this video a few7:24times and go easy on yourself when you7:26make mistakes along the way I'll see you7:28in the next one e

Watch on YouTube ↗

More in this topic

8 Framer shortcuts you're probably sleeping on4:19
8 Framer shortcuts you're probably sleeping on
Layout & Design3K views · 2 months ago
Framer Update: Stack Sorting and Bento Grids2:16
Framer Update: Stack Sorting and Bento Grids
Framer Update7K views · 2 months ago
Sharing Vector Sets Across Projects (Vectors Lesson 7)3:41
Sharing Vector Sets Across Projects (Vectors Lesson 7)
Layout & Design1K views · 3 months ago
Connecting Vector Sets to the Framer CMS (Vectors Lesson 6)3:38
Connecting Vector Sets to the Framer CMS (Vectors Lesson 6)
Layout & Design2K views · 3 months ago
Animating Vectors in Framer (Vectors Lesson 5)4:25
Animating Vectors in Framer (Vectors Lesson 5)
Layout & Design4K views · 3 months ago
Customizing Vectors with Variables in Framer (Vectors Lesson 4)4:59
Customizing Vectors with Variables in Framer (Vectors Lesson 4)
Layout & Design3K views · 3 months ago
Replace component instances site-wide in Framer1:39
Replace component instances site-wide in Framer
Layout & Design4K views · 4 months ago
Creating and Organizing Vector Sets in Framer (Vectors Lesson 3)6:58
Creating and Organizing Vector Sets in Framer (Vectors Lesson 3)
Layout & Design3K views · 4 months ago

Create a free website with Framer, the website builder loved by startups, designers and agencies.