PDA

View Full Version : Scroll only content, not menu.


André Barreto
10-19-2009, 08:23 PM
Hi,

My question it's about the scrollbar. I want it applied only at the content. The logo and the menu, I want both statics. I don't wanna use frames, because I want just the main scrollbar (on the right of the browser), not another one inside the content. The JQuery also isn't a solution.

André

edbr
10-20-2009, 12:35 AM
you can use css for this position:fixed;

André Barreto
10-20-2009, 01:07 AM
Thanks a lot!

Corrosive
10-20-2009, 07:45 AM
This may help if you get stuck

http://corrosiveonline.co.uk/tutorials_scrolling_content.php

André Barreto
10-21-2009, 11:13 PM
Great! Very helpfull!

André Barreto
10-22-2009, 05:33 AM
It worked fine! But there's another question: how I do block the position (fixed) of the gradient of the background withouth blocking everything else? Once I used this css:

body {
background-image:url(image.png);
background-repeat:repeat-x;
}

edbr
10-22-2009, 06:02 AM
dont understand what you mean fix the position of the gradient the code you show repeats the image in the body. if you put that gradient background of a div you could then fix the position of that div. if thats what you are looking for

André Barreto
10-22-2009, 06:40 AM
Yes, I wan't to set the background position to fixed. I believe I have to ajust the repeat on x the 1px image (to do the gradient) in the html, make a div and so put the position in the css, right? But in the html I don't have the option if the repeat.

edbr
10-22-2009, 07:01 AM
sorry still lost what you want.
repeat-x repeat-y will repeat on the x or y axis, repeat on both.
i dont know what you mean by fixed if you put in the body then thats where it will appear
anyone?

Corrosive
10-22-2009, 07:28 AM
Yes, I wan't to set the background position to fixed. I believe I have to ajust the repeat on x the 1px image (to do the gradient) in the html, make a div and so put the position in the css, right? But in the html I don't have the option if the repeat.

Just to clear up. The image and repeat instructions don't go in the HTML. HTML holds you content and the CSS dictates your styles. Set the background and how it repeats in you stylesheet (body style).

André Barreto
10-22-2009, 06:23 PM
I wasn't very clear previously and made a mistake about the html, but I find what I was looking for. It's just one more line in the css:

body {
background-image:url(image.png);
background-repeat:repeat-x;
background-attachment:fixed;
}