Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

clip and vertical center

Status
Not open for further replies.

sogc

Technical User
Jun 8, 2004
34
0
0
CA
I have a big problem. I need to vertically align an image and clip it at the same time. My images are randomly different sizes each time the user refreshes the screen, hence the need to "clip" them. But the problem is the the vertical alignment code that I have found on the boards doesn't work because the clip feature needs to use position: absolute.

Thoughts?
 
Instead of putting the image in there directly as an IMG element, try putting in a DIV and setting the [tt]background-image[/tt] property via CSS. That way, your image will be clipped to whatever size the DIV is.

How are you doing vertical alignment without using absolute positioning?

--
-- Ghodmode

Give a man a fish and he'll come back to buy more... Teach a man to fish and you're out of business.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top