Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8253019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:43:49+00:00 2026-06-08T00:43:49+00:00

Explanation: I have a page with a content div that will change height. When

  • 0

Explanation:

I have a page with a content div that will change height. When the div is small I’d like a nice gradient fade to the background color. As the div grows in height it should push the gradient further down until it is off the page.

Example Page

This example works properly, however I want to know if I can do this without using position:fixed on the gradient div. The reason that I don’t want to use fixed positioning is because the above example looks strange on the iPad when you go to scroll the page up and down. Everything moves except the gradient so it makes the page look broken.

Is there any way to structure my example without using fixed positioning?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:43:51+00:00Added an answer on June 8, 2026 at 12:43 am

    Simply adjust the height of elements and change overflow of body and #content (example):

    <div id="content">
        Content here. Use slider to adjust height.<br />
        <div id="slider"></div>
        This div <strong>should</strong> trigger a scrollbar on the window.
    </div>
    <div id="gradient">Gradient fade to body background. This div <strong>should not</strong> trigger a scrollbar on the window.</div>
    
    html, body {
        height:100%;
    }
    body {
        padding: 0;
        margin: 0;
        background-color: Green;
        overflow:hidden;
    }
    div {
        color: #fff;
        text-align: center;
        font-size: 16pt;
    }
    #slider {
        width: 300px;
        margin: 0 auto;
    }
    #content {
        line-height: 100px;
        background-color: Red;
        overflow:auto;
        max-height:100%;
    }
    #gradient {
        height: 200px;
        line-height: 200px;
        background: Orange;
        width: 100%;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read the explanation in http://en.wikipedia.org/wiki/PageRank and i understand that the page rank
I have a JSP that contains the content at the top of my page,
Explanation I have a multidimensional array that is iterated over to created a categorized
Q1: Is there something like too much ajax?? Explanation: I have been seeing programmers
I have a homework question please help with a little explanation so that I
I have a project for a client that will be using a YouTube comment
I have a live site that includes different php files depending on what page
As a quick explanation, I created an image that resizes to fill the background
I'm using a very standard one-page model for JQueryMobile development like: <div id=page1 data-role=page>Lorem
I want to create an informative app that will display a list of content.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.