Div in body size

Asked

Viewed 624 times

1

I have a div that is in my page footer, similar to a footer, the problem is that this div is inside other Ivs, I wanted it to be the exact size of my body, without touching the html only in css. Example: inserir a descrição da imagem aqui

  • 1

    Please enter your code so we can help you.

1 answer

1


Yes, in order to have this result since the previous Ivs interfere with the width of the desired div you can remove from the static position(the normally used) for absolute and position it. ex:

<style>
div#inner-div{
position: absolute;
width: 100%;
bottom : 0px;
}
<style>

I believe it might solve the problem of not being the size of the body, but there are some precautions you should take into account:

  1. If the div you want to put with body size has content above and below, will come out of the space that was and if you want be in the same place as before should give this space through the areas that stayed there, or use relative position
  2. Power position relative if the parent(selector) has position Absolute
  • I believe that when he says he wants the div the size of his body, he meant height, not width.

  • It was exactly this, adjust the width, the height will self adjust with the content that I will put inside it, thank you very much.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.