CSS scroll effect: overflow and position troubles -


I am trying to create a scrolling effect in pure CSS, where "pages" emerge / slides on each other and The screen is usually out of the way.

My intention was to be an original element which is a comparative and overflow scroll of the situation. Inside it is a "window" in which "page" is included. Overflow is hidden in windows, and the pages are completely located at the top of the parent, and they are the same size.

If it will work as expected, you will be able to see only one page when its window is in view.

In fact, I look at all the pages at the same time, ignoring my parents' overflow hidden property, while they are out of bounds.

I 'once seen this effect in the wild, but I do not remember where and how anyone knows how it is done?

html:

  & lt ;! DOCTYPE html & gt; & Lt; Html lang = "en" & gt; & Lt; Top & gt; & Lt; Title & gt; Newspaper Scroll Test & lt; / Title & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" & gt; & Lt; Link rel = "stylesheet" href = "style.css" type = "text / css" & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "content" & gt; & Lt; Div class = "post" & gt; & Lt; H3 & gt; Test & lt; / H3 & gt; & Lt; Div & gt; Lorem ipsum dolor sit amet. & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "post" & gt; & Lt; H3 & gt; Test & lt; / H3 & gt; & Lt; Div & gt; You do not mess / Div & gt; & Lt; / Div & gt; & Lt; Div class = "post" & gt; & Lt; H3 & gt; Testje & lt; / H3 & gt; & Lt; Div & gt; Fietspomp & lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "post" & gt; & Lt; H3 & gt; Ttpttp & lt; / H3 & gt; & Lt; Div & gt; Lorem ipsum dolor sit amet. & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

CSS:

  #content {height: 200px; Width: 200px; Overflow: Auto; Status: Relative; } .post {Overflow: hidden; Height: 200 pixels; } .post divas {status: absolute; Top: 50px; Left: 0; } .Post H3 {Status: Absolute; Top: 0; Left: 0; }  

I believe that you are going for. Changes made in your CSS are mainly in the .post category:

  .post {overflow: hidden; Status: Completed; Z-index: 1; Top: 50px; Left: 0; Height: 200 pixels; Background: #fff; }  

In the full position rather than setting nested .post div , I have set the whole .post This way you can stack your every content post. I have also added a background color so that the posts can not be visible through each other.

To get a separate page to show, you have to change the Zee-index for more than 1 value.

Alternatively, if you want a scrolling effect with stacked posts after each other, then you can change the CSS like this:

  .post { Overflow: hidden; Height: 200 pixels; Background: #fff; }  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -