9

I'd like to put this properties for a div:

.content {
position: relative;
overflow-y : auto;
overflow-x: visible;
}

According to this page, if one is specified as 'visible' and the other is 'scroll' or 'auto', then 'visible' is set to 'auto'. So it's seem to be impossible to use simultaneously an overflow-y:auto and an overflow-x:visible.

However, I need to put this properties for a website, is there a way to do it ?

Vanessa found the answer by her own. Here it is:

OK, I fixed the problem :) If anyone has this kind of problems : don't forget to remove the relative position of the parent element (this which have the overflow property) : the absolutive div will be placed according the parent div which have the relative position. If not, it will be placed according to body ! – Vanessa Jan 19 '12 at 5:38

5
  • 1
    What are you trying to accomplish? It seems like the site you are linking covers pretty much every combination. Commented Jan 19, 2012 at 1:24
  • ...yes, it seems to me that overflow:auto should just work for you; in the case where the width of the element is greater than the content why do you want a scrollbar to be visible? Can you outline the problem more? Commented Jan 19, 2012 at 1:43
  • I'm trying to accomplish the CSS code I posted in my question. I have .content div of 500*500 pixels, and I need to have an overflow-y inside it, and .player div that is inside the .content div but I need .player to show at a margin-left of -200 pixels with .content div and positioned as an absolute element. Problem: if I put "overflow-y: auto" in .content (to let visitors scroll down in the .content div), the .player div doesn't show, it's hidden (for reasons enunciated in the link I shared). Note that the .player div must absolutely be inside the .content div for loop PHP reasons... Commented Jan 19, 2012 at 4:21
  • 2
    OK, I fixed the problem :) If anyone has this kind of problems : don't forget to remove the relative position of the parent element (this which have the overflow property) : the absolutive div will be placed according the parent div which have the relative position. If not, it will be placed according to body ! Commented Jan 19, 2012 at 5:38
  • 2
    @Vanessa Can you please answer your own question in the "Your Answer" textarea. Commented May 28, 2013 at 10:23

1 Answer 1

1

Vanessa https://stackoverflow.com/users/1151236/vanessa says "OK, I fixed the problem :) If anyone has this kind of problems : don't forget to remove the relative position of the parent element (this which have the overflow property) : the absolutive div will be placed according the parent div which have the relative position. If not, it will be placed according to body ! "

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.