1

I am working on a page with horizontal scrolling and multiple columns. The first column of the text should be centered on the page and the other columns should be visible, too. Here is a sketch, which demonstrates what I have right now – an article with columns which is scrollable: jsfiddle. I would like to see the overflow text, too. I know overflow-y:visible and overflow-y:scroll cannot be combined, but how can achive something similar?

Only the text (article) should be scrollable, not the whole page.

Here are some images which illustrate what I would like to do:

image 1 – starting position image 2 – while scrolling image 3 – scroll end position

2
  • you cannot combine those two, one will trigger auto to the other one. Beside, you look for visible and scroll for the same direction , aren't you ? Commented Jun 15, 2014 at 14:42
  • I know, that I cannot combine these two, but I am looking for something which produces a similar result – scroll with visible overflow. Commented Jun 15, 2014 at 14:46

1 Answer 1

1

Not too sure of what you are looking for, but here is a hint with display and text-indent:

DEMO

CSS to demonstrate idea :

.article-wrapper {
  border:solid;
  width:600px;
  margin:auto;
  text-indent:0;
  transition:1s
}
.article-wrapper:hover {
  text-indent:-500px;;
}
article {
  text-indent:0;
  display:inline-block;
  height:400px;
  width:500px;
  column-width:500px;
}

If this effect wanted, you may look for a way via transition, animation or javaScript to take control over it.

Sign up to request clarification or add additional context in comments.

4 Comments

This will not work, because I have multiple (more than two) columns and the scrolling should be done manually. But the idea with text-indent is interesting.
@Pwdr If you combine pointer-events and bigger text-indent maybe this gives a bit more ideas : codepen.io/gc-nomade/pen/KJEic , here what you can do (with image but can be columns) and a bit more efficient codepen.io/gc-nomade/pen/ActpB you need to retrieve width from javascript to set text-indent value or margin or translate , whatever is the technic you want to support
Thanks for your help! Your idea with text-indent led me to padding – this basically does what I want, the only problem is, that the last column cannot be scrolled to the starting position (the last image in first post), so padding-right seems not to be working there. new jsFiddle
@Pwdr as i suggested you need to retrive width of element in order to get it's width and set the proper value to the negative text-indent (or margin...) . check this where scrollwidth of ul is used and not width :) codepen.io/gc-nomade/pen/KJzLD notice the way to update/insert the rule .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.