Div positioning - css

I have a div tag which has table header on it and the rest of the table content is in another div. I need to make the position fixed when vertical scrollbar is scrolled so that the table header will be seen on vertical scrolling.Upto this point its not a problem because using div position:fixed,it will work. But the problem is during horizontal scroll the header should not be fixed. is there any horizontal and vertical scroll event to make the position fixed and absolute?Please help

Getting elements to respond differently for horizontal scrolling and vertical scrolling sounds like it would be handled best with Javascript. CSS can give you a fixed element, but it will be fixed for both x and y scrolling.

this will help you. pure ccs: http://www.imaputz.com/cssStuff/bigFourVersion.html

Related

How to fix position of central content when vertical scroll is visible?

How to fix position of center content when vertical scroll is visible due to large amount of data. It slightly moved as shown in bellow pictures:
Without vertical scroll is fine
now with vertical scroll:
how i can fix central div when scroll visible?
A common solution is to always show a scrollbar whether it's required on not.
Just add overflow:scroll-y to the body element.

Force element scrollbar to the top using CSS

I have a container on my site that is 100% of the screen width and has its own scrollbar using overflow: auto. The standard scrollbar does not display on my site and I use this instead because there is another layer behind the main layer of my site that also has its own scrollbar (you can view my site here and click a blog post to see what I mean).
I have a blue bar that I want to be fixed to the top of the screen. This is easy enough in terms of positioning in that way with position: fixed however the width of the bar needs to be 100% of the screen width and I'm finding that the bar will overlap the scrollbar that is applied to its parent container.
Here is a jsFiddle showing what I mean: http://jsfiddle.net/xUTR2/1/
I've thought about just offsetting the bar to the left based on the width of the scrollbar, but then I decided that I couldn't rely on estimating the width of the scrollbar across different browsers, and that would leave a gap if there were no scrollbar.
Is there an obvious way to force the scrollbar to render ontop?
As I can't comment yet, im forced to give an answer.
If im correct you would like to get the top blue bar in a fixed position as in visible while scrolling down.
personally i would make seperate containers
something like
<div id='page'>
<div id='bluebar'></div>
<div id='content'></div>
</div>
Demo can be found here ( http://limpid.nl/lab/css/fixed/header )
you can do this by jquery easily, at some event.
$("body").load(function () {
$('scrollable container').css('overflow-y', 'auto');
});
try keeping the blue bar and other page content in separate containers, i think it will solve the problem for you.
This is impossible to achieve in a clean/robust kind of way because anything you position as fixed is done so within the context of the main browser (and within any scrollbar it has), but because you removed the main body scrollbar (and you must because you cannot z-index position on top of it) it doesn't think anything is there, yet you have this div below it so the only options you have are to use fixed margin and height for the two elements or use some javascript method to determine the correct width of your top div.

how do i place a scroll bar outside of the div which is overflowed?

i have a page which has a centered (vertical as horizontal) content div. When the div is overflowed than a scroll bar appears on the right side of the div.
i think this looks ugly and i would like to have the scrollbar on right side of the screen as normal.
Is there anyway to fix this?
the page is available here
thanks guys!
You have to remove the fixed height and the overflow from .content.

Disable Horizontal Scroll on Div

There is a cross browser dilemma especially now that safari uses an internal scroll mechanism that floats on top.
When a div with fixed height's content ends up getting larger than the div we need a scroll bar, but the scrollbar takes out some width and thus a horizontal bar is added to. How do we prevent a horizontal scroll even if the content is to wide I want no ability for the user to be able to scroll horizontally.
The CSS3 property overflow-x:hidden, still allows the user to scroll left and right with a trackpad. I want it disabled completely, or a solution that removes the problem of the vertical scroll bar taking width from the div.
Any ideas?
Marvellous
One solution is that you make the vertical scroll bar always display:
overflow-y: scroll
But still the scroll bar's width doesn't stay the same across browsers.
Or you can make a custom scroll bar replacement with div/CSS/JavaScript. Here is a jQuery plugin which seems promising:
http://jscrollpane.kelvinluck.com/
Set the image as background should fix your issues

Missing Scroll Bar

I seem to be missing a horizontal scroll bar on this page, http://www.animefushigi.com/
If you make your browser window skinner, half the page will be cut off but there will be no scroll bar.
I believe the main content width should be 1024 px before the need of a scrollbar
because the wrapper div does not have a stable min-width(and for browser which not support min-width, such as ie6, there is a child div .wrapper has a stable width in this case, so it will be ok,too ),which should be setted.
e.g.
//add css
#master_wrapper{min-width:1000px;}
It looks like overflow:hidden is used to clear floats in a couple of places. If you get rid of it on #master_wrapper then the horizontal scrollbar will return. However this will cause that element to collapse to a height of 0 and making this image disappear from your page. You can however rearrange your background images using the html for one of them to sort that issue out.

Resources