473,385 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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?

Jan 27 '07 #1
3 2443
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?
--
Johannes Koch
Spem in alium nunquam habui praeter in te, Deus Israel.
(Thomas Tallis, 40-part motet)
Jan 27 '07 #2
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.

On 27 Jan., 11:14, Johannes Koch <k...@w3development.dewrote:
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?
--
Johannes Koch
Spem in alium nunquam habui praeter in te, Deus Israel.
(Thomas Tallis, 40-part motet)
Jan 27 '07 #3
On 2007-01-27, Tobi Hammert <sp*******@gmail.comwrote:
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!
Jan 27 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: anatushi | last post by:
Hi, im looking for help on how to add a text fader to my website, usually i'm working with css but in this case i need to add java script to make it work, that wasn't the problem but somehow it...
4
by: Stuart Norris | last post by:
Dear Readers, I am attempting to draw box around some text using unicode on multiline label. The label is forty characters wide and 12 lines deep. I have been trying to draw a box around text...
6
by: Jerry Camel | last post by:
I want to center an image on the screen and have text centered over the image. What's the best way to do this? I've been playing with style tags and I can get the stuff to center automatically...
7
by: ashkaan57 | last post by:
Hi, I am new to CSS. I want to have an image (170x250) centered and have some text to the right of it, starting from top of the image. I have: ..info { position: absolute; top:100px;
2
by: Joe Delphi | last post by:
Hi, I want to position label text so that it always appears centered when the user re-sizes the browser window. I tried adding the HTML property text-align="CENTER" to the code, but ASP.NET...
18
by: ~john | last post by:
Sorry if this is a dumb question buy my CSS is pretty bad... but how do I get text to center vertically within a div tag? Here's my code below... the text is displaying on the far top-right. I...
3
by: BT | last post by:
I have taken over the support of an existing webpage and I need to revise the page so that it is centered (left and right) on the screen instead of aligned on the left. I can do this easily, but...
12
by: tim | last post by:
I am using foldoutmenu 3 and am having problems with viewing my menus in firefox. On my sub3 menus i have more than one line of text in some places. firefox does not recognise that there is more...
8
by: ayamopamo | last post by:
Hi- I am trying to center a web page. It seems like this should be very simple to do, but apparently it isn't my day. I have successfully centered the background by calling it in the css body tag:...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.