Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to automatically center images on slides? #19

Open
incandescentman opened this issue Jun 16, 2016 · 2 comments
Open

how to automatically center images on slides? #19

incandescentman opened this issue Jun 16, 2016 · 2 comments

Comments

@incandescentman
Copy link

incandescentman commented Jun 16, 2016

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!

@jaydixit
Copy link

img,video,audio,iframe { display: block; margin: 0 auto; }

@Sukarnascience
Copy link

Try out this in your CSS file
body { background:rgb(120, 120, 120); margin: 0; position: absolute; top: 50%; left: 50%; margin-right: -50%; transform: translate(-50%, -50%) }

OR
to center img

.center { display: block; margin-left: auto; margin-right: auto; width: 50%; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants