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

Align an Image - Center

Status
Not open for further replies.

woohahee

MIS
Mar 2, 2001
16
GB
Ok I'm trying to align an image in the center of the screen using a stylesheet. I can find references to vertical alignment just nothing to do with horizontal alignment

My code so far:

IMG
{
BORDER-RIGHT: BLACK 1px solid;
BORDER-TOP: BLACK 1px solid;
MARGIN-TOP: 4pt;
MARGIN-BOTTOM: 4pt;
MARGIN-LEFT: 4pt;
BORDER-LEFT: BLACK 1px solid;
BORDER-BOTTOM: BLACK 1px solid
}

Please help!

Richard
 
The easiesy way is probably to put it in a table and specify it the "traditional" way.
You could use absolute positioning

position: absolute; left: 100px; right 100px etc

Maybe you can use- vertical-align: middle
but i'm not sure!

r if you put it as a background image then you could use something like:


{ background: white url("myimage.gif");
background-repeat: no-repeat;
background-position: center;
}
OR
{ background-image: url("myimage.gif");
background-position: 100% 100%;
background-repeat: no-repeat;
}

etc etc

É
**new site coming soon**
**don't visit just yet**
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top