Posted By

eisabai on 11/15/10


Tagged

css html


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Priestd09


Align image in the middle and center of the page


 / Published in: CSS
 

URL: http://eisabainyo.net/weblog/2010/04/22/align-an-image-in-center-and-middle-using-css/

  1. #enter {
  2. position: absolute;
  3. text-align: center;
  4. left: 50%;
  5. top: 50%;
  6. margin: -120px auto 0 -130px; /* value of top margin: height of the image divide by 2 (ie: 240 / 2), value of left margin: width of the image divide by 2 (ie: 260 / 2) */
  7. width: 260px; /* same as the image width */
  8. }
  9.  
  10. #enter span a {
  11. display: block;
  12. width: 260px;
  13. height: 240px;
  14. margin: 0 auto;
  15. position: relative;
  16. background: transparent url(images/enter.jpg) 0 0 no-repeat;
  17. text-indent: -5000em;
  18. outline: 0;
  19. }
  20.  
  21.  
  22.  
  23.  
  24. <body id="homepage">
  25. <div id="enter">
  26. <span><a href="/home">Enter Site</a></span>
  27. </div>
  28. </body>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: shahab on December 10, 2017

final exam practice

.container{ width: 100%; border: 1px solid gray; } a:link { color: red;} .intro { background-color: black; color: white; padding:1em; text-align: center;} .thirddiv { margin-left: 160px; border-left: 1px solid gray; padding: 1em; } .menu { float:left; height:300px;}

img {

width: 100px; height: 90px; float: left; align: middle; }

img2 {

width: 100px; height: 90px; float: right; align: middle; } table, th, td { border: 1px solid black; border-collapse: collapse; text-align: center; border-spacing: 5px; }

American University in the Emirates

AUE

American University in the Emirates’ (AUE) motto is that “Nothing is Impossible” and through this empowering phrase it continuously nurtures its students to take on their studies like taking on the working world, through a perfectly constructed pathway to success.

Since establishing in 2006 with accreditation from the Ministry of Education, AUE has grown with an ever-increasing number of students from 25 different countries. With an American educational system intact, AUE boasts six colleges of Media and Mass Communication, Business Administration, Law, Fine Arts and Design, Computer Information Technology and Education, which all cater to the current and future needs of all the dominating and niche markets.

email First Name:

Last Name:

E-mail:

Male

Female

Other

sweetness wolfhard

First Name
Last Name


Adolf
Hitler

Copyright © AUE CCIT.com

You need to login to post a comment.