post #11 of 11
Quote:
Originally Posted by graphicsman View Post
ya i found that out last night, it works, but i cant get it to image to center on the x and y axis and im stumped on how to code for universal size images
centering horizontally is easy, you just need to specify a width with the margin:auto (it can't assign auto without a width)
So do this :
Code:
<div class="realtorlogo">
<div style="width:100px; margin:auto;">
<img src="images/century_21_logo.jpg" style="max-width:100px;" alt="Realtor Logo" />
</div>
</div>
centering vertically is more difficult, read this : http://phrogz.net/css/vertical-align/index.html

Use that if you can otherwise,
a complicated way of doing it would be to use javascript to calculate the height of the image after it gets resized, subtract that from the height of the container and divide by two to apply padding to the top/bottom
Main PC
(13 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k Asus Maximus IV Gene-Z MSI 6950 2gb Unlocked Ref GSkill Ripjaws X 8GB CL8 
Hard DriveOSMonitorKeyboard
Crucial M4 128GB Windows 7 Ult Samsung 24" ToC Das Professional Silent 
PowerCaseMouse
Seasonic X750 Corsair 650d Logitech G700 
  hide details  
Reply
Main PC
(13 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k Asus Maximus IV Gene-Z MSI 6950 2gb Unlocked Ref GSkill Ripjaws X 8GB CL8 
Hard DriveOSMonitorKeyboard
Crucial M4 128GB Windows 7 Ult Samsung 24" ToC Das Professional Silent 
PowerCaseMouse
Seasonic X750 Corsair 650d Logitech G700 
  hide details  
Reply