Shiny: Aligning images using img src

Created on 29 Jul 2014  Â·  2Comments  Â·  Source: rstudio/shiny

Hi,

I have quickly become a fan of RShiny. Hence posting back to back questions :)
The following line is not aligning the image to the middle. It still keeps it to the left:

img(src ="shine-background-3.jpg", height = 225, width = 300,align="center")

Any suggestions, please?
Thanks

Most helpful comment

The align attribute of <img /> is not what you need. It is a different thing (http://www.w3schools.com/tags/att_img_align.asp). You can use style="display: block; margin-left: auto; margin-right: auto;" to center an image. Or div(img(...), style="text-align: center;").

All 2 comments

The align attribute of <img /> is not what you need. It is a different thing (http://www.w3schools.com/tags/att_img_align.asp). You can use style="display: block; margin-left: auto; margin-right: auto;" to center an image. Or div(img(...), style="text-align: center;").

Works perfect!!! Thanks so much :)

On Tue, Jul 29, 2014 at 9:41 PM, Yihui Xie [email protected] wrote:

Closed #555 https://github.com/rstudio/shiny/issues/555.

—
Reply to this email directly or view it on GitHub
https://github.com/rstudio/shiny/issues/555#event-147054730.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

howardcoleman picture howardcoleman  Â·  5Comments

Toniiiio picture Toniiiio  Â·  4Comments

FrissAnalytics picture FrissAnalytics  Â·  5Comments

wch picture wch  Â·  3Comments

Stophface picture Stophface  Â·  3Comments