• Home
  • About
  • Contact
  • Advertise

Devlounge

Design, Develop, and Grow

ateşli sevgilisi fantezisini yaşamak istediğini söyler porno ona arkadaşları varken onunla gizli saklı seks yapmak istediğini sikiş söyleyen kız hafta sonu için gelen arkadaşının görmediği bir sikiş açıdan sakso çekmeye başlayınca adamın yarağını bu altyazılı porno şekilde indiremez ve açık şekilde salonda sikişimeye sex izle başladıklarında misafir kızı da bu sekslerine rokettube konuk ederler seks yapacağını düşünmeyerek onun sex izle oyun oynadığını zanneder sabah olur ve herkes uyanır hd porno bu sırada yanında şişme mankenini de getiren sapık erotik hikayeler genç sınav haftası ders çalışan genç adam üvey annesinin sikiş eve gelmesiyle hayatının şokunu yaşar

  • Home
  • Code
  • Design
  • Design Focus
  • Interviews
  • Publishing
  • Strategy
  • Webapps
  • Extras

Centering images with CSS

June 15, 2009 By Lorraine

We’ve covered aligning images to the left and right before, and today I want to talk about centering your images with CSS. If you remember the old way (without the magic of CSS), it was something like this:

<p align="center">centered image here</p>

Look familiar? There’s also:

<center>centered image here</center>

Of course, you don’t want to do that. Both ALIGN and CENTER here are deprecated- and besides, the beauty of CSS is that it’s supposed to make our lives easier, right? Now let’s say I want all of the images in my blog posts to be centered nicely. Instead of having to select each one and applying the dreaded ALIGN or CENTER, all I’d have to do, really, is this:

.post-body img { display: block; margin-left: auto; margin-right: auto }

I want to give you a quick explanation of what we’re doing here. The truth is that although I’ve been using that bit of code for a long time, I never thought to ask exactly how it worked. So here’s what this does:

First, it makes the image into a block – thereby making it unnecessary to add any additional <div> or <p> tags around it. Then it tells the browser displaying it to set left and right margins to auto.

When you set these to “auto”, what you are actually doing is telling the browser that you want left and right margins to be equal – which is really another way of describing centering.

Wasn’t that easy? How do you align your images?

Filed Under: Code Tagged With: align images, css, image align

Code & Tutorials

Which Front-End Development Languages Will Grow in 2017?

Your Guide to Leveraging APIs as a Developer

Bitcoin Processing Website Integration For Web Developers

Website Security For 2016 That All Developers Need To Know

5 Reasons You Need to Be Using jQuery

About Devlounge

Want to read more about Devlounge, or maybe you want to contact us, or even advertise? Oh, and don't forget to subscribe to updates!

The Best of Devlounge

5 Ways to Use Social Media to Make Money

Search