Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / January 2007



Tip: Looking for answers? Try searching our database.

css text layer, centered, but same 'height' -> how can it be done?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tobi Hammert - 27 Jan 2007 09:57 GMT
i have a page that shows a random picture, centered.
how do i create a layer that stays centered, but always 300 px down
from the top?

to make it clear again: i want to place a text layer, x=centered,
y=300.

is it even possible, or do layers have get absolute positions?
Johannes Koch - 27 Jan 2007 10:14 GMT
Tobi Hammert schrieb:
> i have a page that shows a random picture, centered.
> how do i create a layer that stays centered, but always 300 px down
> from the top?
>
> to make it clear again: i want to place a text layer, x=centered,
> y=300.

margin: 300px auto 0 auto;
width: 45em; /* e.g. */

What about the 'same height' from the subject?
Signature

Johannes Koch
Spem in alium nunquam habui praeter in te, Deus Israel.
                         (Thomas Tallis, 40-part motet)

Tobi Hammert - 27 Jan 2007 15:38 GMT
hm... this does not work.
the text layer should be placed on top of the picture...
now its just adding the 300px and putting the text under the picture.
but i want the text to cover the pic.

> Tobi Hammert schrieb:
>
[quoted text clipped - 11 lines]
> Spem in alium nunquam habui praeter in te, Deus Israel.
>                           (Thomas Tallis, 40-part motet)
Ben C - 27 Jan 2007 15:57 GMT
> hm... this does not work.
> the text layer should be placed on top of the picture...

The problem is we don't know what the rest of your document looks like.
It would work in many circumstances. Post a link to your page.

> now its just adding the 300px and putting the text under the picture.
> but i want the text to cover the pic.

This is a similar suggestion:

div.text_layer
{
   position: absolute;
   width: 10em;
   margin: 0 auto;
   top: 300px;
   left: 0;
   right: 0;
}

...

<div class="text_layer">text</div>

That will probably put the text layer on top if the image is
normal-flow. But it all depends on the rest of the document which we
can't see!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.