Login | Register | FAQ
Anonymous

Align

+ Post a reply

3 posts Page 1 of 1


Align

by iDana » Sat May 21, 2011 6:40 pm

How would you Align an Image and Text to be align via the centre.
User avatar

iDana

  • Posts: 60
  • Joined: Tue Oct 26, 2010 10:05 am
--
iDana

Re: Align

by HTML.net » Sun May 22, 2011 8:44 am

You set the margins to auto:

<p style="width:10em; margin-left: auto; margin-right: auto;">This text is centred</p>

<img src="picture.png" alt="Aligned image" style="display: block; margin-left: auto; margin-right: auto;" />

- Andreas, HTML.net
User avatar

HTML.net
Site Admin

  • Posts: 1185
  • Joined: Sat Sep 11, 2010 11:24 am
--
Show some love for HTML.net on Twitter, Facebook and Google: Use the buttons on top of all pages.

Re: Align

by iDana » Sun May 22, 2011 11:37 am

Thanks Andreas!
User avatar

iDana

  • Posts: 60
  • Joined: Tue Oct 26, 2010 10:05 am
--
iDana


+ Post a reply

Page 1 of 1

?>