On 07.12.2011 01:23, Lisa Frost wrote:
On this site: http://www.flyingwithdiabetes.com/ the image of the book
in the side bar needs to be centered.
 One way to achieve auto-centering of images...

p .bookcover {
display: block;
margin: 10px auto;

position: relative;
left: -2px;
}

...where the first two lines/declarations centers the image, by turning it into a block-element which will take margins on all sides.

The two last lines/declarations offset the image a couple of pixels so it looks centered in the sidebar even though left and right margin on the paragraph containing the image do not have the same value. Adjust this offset to taste.

regards
        Georg
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to