On 12/8/11 10:26 PM, "G.Sørtun" wrote:
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


There are many ways to do this. Georg provided one way. And the distinct advantage of what he has provided is that no markup change is needed.

Fwiw, another way is to play with this [*it does requires a markup change* -- css in head of document]... <http://chelseacreekstudio.com/lisa.htm>

~d


--
Desktop. Laptop. Tablet. Mobile!
http://chelseacreekstudio.com/

______________________________________________________________________
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