473,787 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2458
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...@w3develop ment.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*******@gmai l.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_lay er">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
1855
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 seems like they are not compatible with each other so when i add the text fader code in the <body> tag,the rest of my site is gone :S if someone please can have a look at my code and tell what am i doing wrong. thx allot for whom of you who can =) ...
4
12345
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 (centered in the label) on this label. My font on this label is Courier new - hence fixed width character cells.
6
2324
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 OR have the text appear on top of the image. But in the second case, the image and text aren't centered properly. Any help is appreciated... Jerry
7
13828
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
2652
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 doesn't seem to recognize this HTML attribute. Can someone tell me how to do this?
18
7948
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 would like it far right centered vertically. #test { width: 100%; height: 55px; margin: 0 0 0 0;
3
3666
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 there is a little JavaScript that doesn't work correctly after I center it. I have tried to realign the page with either <centertag or align="left" attribute, but the pictures displayed with the JavaScript get messed up with everything I've...
12
2616
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 than one line and the text simply overlaps the sub-menus below it. I thought i had got around this by placing empty 'spacers' like so; oFoldMenu.make('sub3','')//spacer unfortunately, i have just viewed the site in IExplorer and it has added...
8
3554
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: body { font-family: Trebuchet MS, Arial; cursor : default; background:#000000 url("Images/long-template.jpg"); background-repeat:no-repeat; background-position: center; background-attachment:scroll; height: 1228px;
0
10363
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10169
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.