Skip to content

how to automatically center images on slides? #19

@incandescentman

Description

@incandescentman

I believe I've tried all available org-mode to HTML and Markdown to HTML slideshow systems, and org-html-slideshow is still the best I've seen. I am having an issue, though, centering images in presentations. Forgive the newbie question, non-programmer here.

I have a lot of slides that consist of images. The org subtree looks like this:


* Foo Slide Title                                                   :slide:
[[/Users/foo/Dropbox/presentations/org-html-slideshows/bar/img/image.jpg]] 

This works perfectly for generating slides with images, except that the images are left-aligned when I want them centered. I want them to align with the slide title, which is also centered horizontally.

I tried adding this CSS, but it had no effect:

p.image {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

This didn't work either:

.figure {
    width: 100%; 
    margin-left: auto;
    margin-right: auto;
}

Can you help me make it so images get automatically centered? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions