Switch to full style
CSS code examples
Post a reply

vertically and horizontally centering of html elements

Tue Jan 08, 2013 11:58 pm

vertically and horizontally centering of html element ( Image , tables or any other tags) .
css code
<html>
<head>
<title>centering an image</title>

<style type="text/css">
.divCenter {
display: table-cell;
border:1px solid blue;
text-align: center;
vertical-align: middle;
width: 100px
height: 100px;
}
.divCenter * {
vertical-align: middle;
}
.divCenter {
display: block;

}

</style>

</head>

<body>
<div class="divCenter">
<img src="loader.gif" alt="Loader">
</div>

</body>
</html>




Post a reply
  Related Posts  to : vertically and horizontally centering of html elements
 get HTML elements attributes values using JQuery     -  
 Can I display same vertically on right side?     -  
 Add elements to the end of an array     -  
 elements of a GridBagLayout organized     -  
 clone arrayList elements     -  
 count elements in a vector     -  
 lesson5: XSD Complex elements     -  
 Elements of a Java Program     -  
 Add border around ordered list elements     -  
 Elements of the enumerated array are numbers     -  

Topic Tags

CSS Border, CSS Align