Titan97
Titan97

Reputation: 67

The bottom of border missing in my webpage

I am attaching the html and css code here

The problem is, even after using overflow: scroll property in css, the bottom of the page isn't visible unless I resize the window to some weird proportion. One more problem is, not just the border. everything below that is not visible and I cant scroll below to see it. Giving scroll property to the div container destroys the image positions.

body {
  background-color: #001126;
  margin: 0;
  overflow: scroll;
}

.container {
  border-style: solid;
  border-color: white;
  margin: 70px;
  color: white;
  padding: 80px;
  font-size: 30px;
  position: fixed;
}

.menu {
  top: -40px;
  left: -40px;
  position: absolute;
}

.social {
  margin-top: 5%;
  position: absolute;
}

.icons;
{
  position: absolute;
}

#img {
  padding-left: 20px;
  padding-bottom: 10px;
}
  <div class="container">
    <div class="contents">
      <p id="text">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content
        here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy.
        Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
    </div>
    <div class="menu"><img src="icon.png" style="height: 50%;width:50%"></div>
    <div class="social">
      <div class="icons">
        <img src="fb.png" style="height: 8%;width:8%" id="img">
        <img src="insta.png" style="height: 8%;width:8%" id="img">
        <img src="tw.png" style="height: 8%;width:8%" id="img">
        <img src="u.png" style="height: 8%;width:8%" id="img">
        <img src="vid.png" style="height: 8%;width:8%" id="img">
      </div>
    </div>

Upvotes: 0

Views: 290

Answers (2)

Younis Ar M
Younis Ar M

Reputation: 941

Please find the plunkr solution here :

https://plnkr.co/edit/aA4aKpRa467kCuXcZ6bp?p=preview

body {
  background-color: #001126;
  margin: 0;
}

.container {
  border-style: solid;
  border-color: white;
  height: 100%;
  margin: 70px;
  color: white;
  padding: 80px;
  font-size: 30px;
}

.menu {
  top: -40px;
  left: -40px;
  position: absolute;
}

.social {
  margin-top: 5%;
  position: absolute;
}

.icons;
{
  position: absolute;
}

#img {
  padding-left: 20px;
  padding-bottom: 10px;
}
<div class="container">
  <div class="contents">
    <p id="text">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content
      here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy.
      Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
  </div>
  <div class="menu"><img src="icon.png" style="height: 50%;width:50%"></div>
  <div class="social">
    <div class="icons">
      <img src="fb.png" style="height: 8%;width:8%" id="img">
      <img src="insta.png" style="height: 8%;width:8%" id="img">
      <img src="tw.png" style="height: 8%;width:8%" id="img">
      <img src="u.png" style="height: 8%;width:8%" id="img">
      <img src="vid.png" style="height: 8%;width:8%" id="img">
    </div>
  </div>

Upvotes: 0

athi
athi

Reputation: 1683

This was beacuse you gave position: fixed to the container.

body {
  background-color: #001126;
  height: auto;
  margin: 0;
  overflow: scroll;
}

.container {
  border-style: solid;
  border-color: white;
  height: 100%;
  margin: 70px;
  color: white;
  padding: 80px;
  font-size: 30px;
}
<div class="container">
  <div class="contents">
    <p id="text">some large text</p>
  </div>
  <div class="menu"><img src="icon.png" style="height: 50%;width:50%"></div>
  <div class="social">
    <div class="icons">
      <img src="fb.png" style="height: 8%;width:8%" id="img">
      <img src="insta.png" style="height: 8%;width:8%" id="img">
      <img src="tw.png" style="height: 8%;width:8%" id="img">
      <img src="u.png" style="height: 8%;width:8%" id="img">
      <img src="vid.png" style="height: 8%;width:8%" id="img">
    </div>

Upvotes: 2

Related Questions