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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

image alignment in div tag

Status
Not open for further replies.

ringadeal

Technical User
Jan 16, 2008
67
US
i would like to place an image to be postitioned in the top-right corner of a div tag. How is this acheived?
 
float right. relative positioning. absolute positioning. background-image.

probably a few more ways that I've missed.

Code:
{ 
background-image:url('smiley.gif');
background-repeat:no-repeat;
background-position:top right; 

}

Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
thanks
the code works great

I have used it to create a rounded corner effect in the top right corner of a box.

Now my question is how I can create a rounded corner effect in the top-left of this same div tag by placing a different image there
 
This is the drawback with only asking things piecemeal - you can't get an accurate answer straight away.

While the CSS 3 specs will allow for multiple background images, you'd be hard pushed to find good browser suport for this right now. You'll have to have absolutely-positioned containers to hold your different images.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Or google for one of the many 'html css rounded corners' solutions out there.

or 'bulletproof web design rounded corners' and find one of Dan Cederholm's solutions. (I've used these in more than one place).

All of them require a little extra markup, but can provide pure css solutions to your problem/question.

Pick one and come back if you have questions.

Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
how are the absolutely positioned containers accomplished between my current div tags.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top