1 reply [Last post]
millers
millers's picture
Offline
Enthusiast
Last seen: 20 weeks 6 days ago
Timezone: GMT+1
Joined: 2004-11-22
Posts: 70
Points: 41

Let me set the scene, I have an image that will span the full width of the page, however the height of the image is not known (to fit the design it is a letterbox image so between 250 and 300px high).

Over this image I am placing some text, the text is to be horizontaly and vertically centered.

Behind the text is a white box to help the text stand out with 0.7 trabnsparency to also let the image show through.

I want the text with the semi trans background to be the height of the image with the text horizontally and vertically centered within it.

I have tried all sorts of methods from vertical stretching to table-cell but not knowing the height of the image is causing all sorts of issues. Is it possible or should I fix the image height?

Thanks

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 39 weeks 6 days ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Code?

Please post your existing markup and css for the issue. Otherwise we may take you to a land far far away from where you want to go.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.