How do I center these images in the middle (HTML and CSS)? -


i these 4 images centered in middle of screen while still remaining side side are.

<h2><img src="images/colorado parks.gif" alt="button colorado parks webpage" id="colparks"/></h2> <h2><img src="images/colorado monuments.gif" alt="button colorado monuments webpage" usemap="#gotocolmons" id="colmonuments"/></h2> <h2><img src="images/spotlight park.gif" alt="button spotlight park webpage" id="spotpark"/></h2> <h2><img src="images/places stay.gif" alt="button places stay webpage" id="tostay"/></h2> 
#colmonuments, #spotpark, #tostay, #colparks {     float:left;     margin: 8px; } 

looks display:inline-block best that.

demo: http://jsfiddle.net/nn82mzjj/

.class-name {     text-align: center;     font-size: 0; } .class-name h2 {     margin: 0 8px;     display: inline-block;     font-size: 16px; /*adjustable*/ } 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -