Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS positioning text over an image Re: positioning text over an image

#69585
dcp3450
Participant

Given your description the screen shot is the way you want it to look and there is only an issue when you resize. Correct?

Can you also upload a screen shot of what happens when it messes up?

It looks like you want the text to stay beside the image. Try this don’t use the absolute positioning. Try this instead:

set .image to display: block and remove the relative positioning. use margins to center (google "center div with margins")

create a class that has your image and float it float it left such as
.imageToUse
{
background: transparent url(collage_about_us_cropped_resized.jpg) no-repeat top left;
height: xx px;
width: xx px;
float: left;
}

remove the absolute positioning for the text. and use padding / margins to position your text relative to .image and .imageToUse

Tried to help you with your code but leave enough holes so you can do some research and learn this stuff better. There are a few ways to learn this stuff:

ask, research, play, and practice. You did the first part, I’m pushing you to the second part.

Hope this helps.