[Web4lib] HTML question

lib rch.library at rch.org.au
Tue Apr 18 20:17:38 EDT 2006


hi Lynne,

to get horizontal centering on an element, use:
margin:0 auto;

of course that won't work in IE, you will need to use text-align:center; on
the element's container (and reset it to left on the element itself if
necessary).

http://css-discuss.incutio.com/?page=CenteringBlockElement
http://www.yourhtmlsource.com/stylesheets/csslayout.html#centering

v.



At 05:09 PM 18/04/2006 -0600, you wrote:
>Howdy, folks,
>This is so basic I feel quite dumb for even asking, but anyway:
>I have been reading the HTML 4.0.1 specs in an effort to get my pages to 
>validate. One of the things it says is that IMG ALIGN attributes are 
>bottom, middle, top, left, right. Middle is a vertical attribute. So how 
>does one center an image on a webpage horizontally? I have been blithely 
>using "align=center" for years, which has always worked fine, but it's 
>not valid. I don't want to center every image on all my webpages - do I 
>have to add yet another class to my already innumerable CSS classes?
>Lynne
>-- 
>L. E. Puckett
>Reference & Electronic Systems Librarian
>Parmly Billings Library
>510 North Broadway, Billings, MT 59101
>http://www.billings.lib.mt.us
>Ph: 406-657-8258
>
>_______________________________________________
>Web4lib mailing list
>Web4lib at webjunction.org
>http://lists.webjunction.org/web4lib/
>


More information about the Web4lib mailing list