Click to See Complete Forum and Search --> : Two questions


xinman
12-08-2005, 08:45 PM
I'm getting the basics of CSS down a little, but I have two questions that I cannot seem to find the answers to.

1.) I would like to make a horizontal menu across the top of the page, but I want it to stay at the top of the page (ie. even if you scroll down) is this possible with CSS or do I still have to have frames for this?

2.) I would like to be able to past text on top of an image, is there a way to make sure that regardless of what the screen resolution it always show around the same spot?

Thanks for you help
Dan

LJK
12-08-2005, 10:14 PM
Hi -
Okay, my 2 cents would be:
1. If you have a paragraph with margin:0 auto; and width:100%; [and the body styles include text-align:center; margin:0; padding:0;] and it's the first tag after body and maybe a containing division, then it'll be at the top of the page...

2. I like to set a background image for a div, then the paragraph within it would hold any text.

Good luck,
El

Kravvitz
12-08-2005, 10:39 PM
Both of those are possible with CSS.

I would not recommend that someone without much experience try the first one. Due to IE6's limited support for CSS2 -- IE6 doesn't support position:fixed (http://www.w3.org/TR/REC-CSS2/visuren.html#propdef-position) -- you might need to use some JavaScript to make the menu stay at the top of the viewport.

The second one is easy if you make the image a background image like LJK sugested.