# Body size / What code is required?

**URL:** https://meta.discourse.org/t/body-size-what-code-is-required/301642
**Category:** Development
**Tags:** css
**Created:** [March 30, 2024, 11:38am UTC](https://meta.discourse.org/t/body-size-what-code-is-required/301642 "2024-03-30T11:38:50Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ogulcan1787](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ogulcan1787/32/128589_2.png) [@ogulcan1787](https://meta.discourse.org/u/ogulcan1787)
#### Post date: [March 30, 2024, 11:38am UTC](https://meta.discourse.org/t/body-size-what-code-is-required/301642/1 "2024-03-30T11:38:51Z")

</div>

Hi everyone.  
I added border radius to this code and made the bottom part as I wanted.  
But I can’t fix the top part.

What codes should I add to make the upper part look just like the lower part?

like : top-height-size: -30%; ? but this not working

 ![Ekran görüntüsü 2024-03-30 143402](https://global.discourse-cdn.com/meta/original/4X/b/3/9/b39b7589363d0200f2785640707b9cae0f310669.png)

 ![Ekran görüntüsü 2024-03-30 143836](https://global.discourse-cdn.com/meta/original/4X/1/6/e/16e6413a5045b25d6dae721bd24372da8e04d367.png)

```plaintext
body:before {
  display: inline-block;
  border-radius: 15px;
  width: 1125px;
  min-height: 100%;
  height: inherit;
  background-color: #fff;
  content: " ";
  position: fixed;
  left: 50%;
  right: 0;
  transform: translate(-50%, 0);
  -webkit-transform: translate(-50%, 0);
}

```

---

<div class="post-metadata">

### Author: ![bryce](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bryce/32/377822_2.png) [@bryce](https://meta.discourse.org/u/bryce)
#### Post date: [March 30, 2024, 1:56pm UTC](https://meta.discourse.org/t/body-size-what-code-is-required/301642/2 "2024-03-30T13:56:27Z")

</div>

I’m, sorry but it doesn’t seem clear what you need to do. Could you please add more details about:

1. What specific part of the page you are trying to change.
2. What change you are trying to make.

---

<div class="post-metadata">

### Author: ![ogulcan1787](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ogulcan1787/32/128589_2.png) [@ogulcan1787](https://meta.discourse.org/u/ogulcan1787)
#### Post date: [March 30, 2024, 2:22pm UTC](https://meta.discourse.org/t/body-size-what-code-is-required/301642/3 "2024-03-30T14:22:20Z")

</div>

![newtop](https://global.discourse-cdn.com/meta/original/4X/1/b/a/1baffd0110f05096f5cea006724bee875d6cfda2.png)  
The top part, I want to do it like this  
[https://pvpfarm.com](https://pvpfarm.com)  
I want to add border radius like bottom(under) part  
All I want is to have some space at the top between it and the header.

My English is bad, sorry. Thank you for help

---

<div class="post-metadata">

### Author: ![bryce](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bryce/32/377822_2.png) [@bryce](https://meta.discourse.org/u/bryce)
#### Post date: [March 30, 2024, 4:35pm UTC](https://meta.discourse.org/t/body-size-what-code-is-required/301642/4 "2024-03-30T16:35:47Z")

</div>

It’s ok, your English is good, but code can be tricky to talk about! Thank you for adding more details. I think the problem makes sense.

Sometimes you can you use margin-top to add more space above.

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/2/6/e264bf6847f7b475d97feb15c8cdca318a45d040.png)

But it does not work when you scroll!

 ![image](https://global.discourse-cdn.com/meta/original/4X/b/8/7/b874595a3997e0fd8f1793b47522ac2881a91918.png)

This is because there is `position: fixed` in the `body:before` part, so it will alway stay in the same spot on the screen. Let’s change it to `position: absolute` instead. ‘Absolute’ lets us tell it how far from the sides we want the edges. We need to tell it to use `body` for the sides, so we need to add this code:

```plaintext
body {
  position: relative;
}

```

(If you want to learn more about `position`, `fixed`, and `absolute` here [here](https://blog.hubspot.com/website/css-position) is a post with examples)

Ok, let’s delete `min-height: 100%` from `body:before`, because we want it to be shorter than 100%. Now we can control where the top and bottom are! Let’s add `top: 70px` and `bottom: 30px`. (Top needs to be big enough to go past the header from the top of the screen).

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/8/3/9830b5061c368fd4f3ecda5b577178538835d854.png)

Does that seem how you wanted? Let me know if it makes sense. 🙂

---

<div class="post-metadata">

### Author: ![ogulcan1787](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ogulcan1787/32/128589_2.png) [@ogulcan1787](https://meta.discourse.org/u/ogulcan1787)
#### Post date: [March 30, 2024, 6:56pm UTC](https://meta.discourse.org/t/body-size-what-code-is-required/301642/5 "2024-03-30T18:56:40Z")

</div>

You are amazing!  
Thank you for teaching me instead of giving me ready-made codes. ❤  
@bryce

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 29, 2024, 6:57pm UTC](https://meta.discourse.org/t/body-size-what-code-is-required/301642/6 "2024-04-29T18:57:30Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
