# Is the width property relative or absolute?

**URL:** <https://community.thunkable.com/t/is-the-width-property-relative-or-absolute/76094>\
**Category:** Questions about Thunkable X\
**Created:** [May 10, 2019, 12:17am UTC](https://community.thunkable.com/t/is-the-width-property-relative-or-absolute/76094 "2019-05-10T00:17:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![talkingtree](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@talkingtree](https://community.thunkable.com/u/talkingtree)\
**Post date:** [May 10, 2019, 12:17am UTC](https://community.thunkable.com/t/is-the-width-property-relative-or-absolute/76094/1 "2019-05-10T00:17:50Z")

</div>

Hi,

In the design phase there are the option of relative or absolute size  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/f/1fae2962d74e558a466abf0692006a6e000e094f.png)

I want to customise the same settings using blocks, however, how do I know which properties these are? For example the 100 and 20 here, are these ,relative or absolute, px or %?  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/c/8cdd99c60c1cdbef5b2b835e44858ba573ce4e0a.png)

It seems like margin and padding cannot be customised in blocks  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/6/160b4eac34e45ad3ab95dae389f18582da67f6b2.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/7/1775c74e7ebe22cfb6a62ce0ab6688ab7526276a.png)

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [May 10, 2019, 12:37am UTC](https://community.thunkable.com/t/is-the-width-property-relative-or-absolute/76094/2 "2019-05-10T00:37:22Z")

</div>

Hi there,

It’s absolute size (in pixels) that is set when you set the size using blocks.

---

<div class="post-metadata">

**Author:** ![talkingtree](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@talkingtree](https://community.thunkable.com/u/talkingtree)\
**Post date:** [May 10, 2019, 12:42am UTC](https://community.thunkable.com/t/is-the-width-property-relative-or-absolute/76094/3 "2019-05-10T00:42:47Z")

</div>

@jane ok ty, can this be adjusted to relative?

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [May 10, 2019, 9:26am UTC](https://community.thunkable.com/t/is-the-width-property-relative-or-absolute/76094/4 "2019-05-10T09:26:11Z")

</div>

You can do the calculations yourself Terry, relative to the width of the Screen.

i.e 25% is `from Screen1 get width / 4`

Hope that helps!

---

<div class="post-metadata">

**Author:** ![talkingtree](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@talkingtree](https://community.thunkable.com/u/talkingtree)\
**Post date:** [May 10, 2019, 10:44am UTC](https://community.thunkable.com/t/is-the-width-property-relative-or-absolute/76094/5 "2019-05-10T10:44:08Z")

</div>

@domhnallohanlon my question is how do you use “relative” as % rather than “absolute” as px, seems like that was not defined

Tried putting 1/4 in the math blocks, however, it always resolve to 1. The percentage cannot be entered either.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/3/e3275dbe0e351d2191b5152770ba51e742db4fa4.png)

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [May 10, 2019, 10:47am UTC](https://community.thunkable.com/t/is-the-width-property-relative-or-absolute/76094/6 "2019-05-10T10:47:04Z")

</div>

Yes, but it has to be “relative” to something else. In my example above I outlined how to set the width of a component to 25%, **relative to** the width of the Screen. i.e `Screen width / 4`

---

<div class="post-metadata">

**Author:** ![talkingtree](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@talkingtree](https://community.thunkable.com/u/talkingtree)\
**Post date:** [May 10, 2019, 11:11am UTC](https://community.thunkable.com/t/is-the-width-property-relative-or-absolute/76094/7 "2019-05-10T11:11:36Z")

</div>

@domhnallohanlon oh I see, it seems like the drop down doesn’t have “width” option though?

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/4/a473bd287540fdafe462b007c66ae16650bfb4ef.png)

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [May 10, 2019, 2:28pm UTC](https://community.thunkable.com/t/is-the-width-property-relative-or-absolute/76094/8 "2019-05-10T14:28:15Z")

</div>

Hah! Well, that’s inconvenient 😂

Turns out you can just use strings for relative sizing like this:

![23](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/6/66c53e60ca06fabb1667d14c0f84afa223401ca8.png)

---

<div class="post-metadata">

**Author:** ![talkingtree](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@talkingtree](https://community.thunkable.com/u/talkingtree)\
**Post date:** [May 11, 2019, 12:02am UTC](https://community.thunkable.com/t/is-the-width-property-relative-or-absolute/76094/9 "2019-05-11T00:02:38Z")

</div>

@domhnallohanlon ohhh that’s cool, use string rather than integer, thanks for the help!

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:13pm UTC](https://community.thunkable.com/t/is-the-width-property-relative-or-absolute/76094/10 "2024-11-08T12:13:48Z")

</div>


