[TW5] How do I center an image?

99 views
Skip to first unread message

charleyc...@gmail.com

unread,
Jun 26, 2017, 10:59:16 PM6/26/17
to TiddlyWiki
I'm trying to bring an image to the middle of a toddler. I'm using the format [img[http://image hosting.com/image.png]].

How do I accomplish this?

Mark S.

unread,
Jun 27, 2017, 12:52:00 AM6/27/17
to TiddlyWiki
I imagine by morning someone will give you a good answer, but this seems to work. The image link allows you to insert a class, and you can use html to create classes on the fly. So you can have

<style>
.centerme {
  display
: block;
  margin
-left: auto;
  margin
-right: auto }
}
</style>

[img
class="centerme" [http://image hosting.com/image.png]]

If you want to reuse the class for many images,  then you would put the class description into it's own tiddler and tag it $:/tags/Stylesheet

HTH
Mark

PMario

unread,
Jun 27, 2017, 7:21:16 AM6/27/17
to TiddlyWiki
Hi
You may have a look here: https://groups.google.com/d/msg/tiddlywiki/Fbeo5zYZJp4/atBd8-D4AwAJ I did link a json file to the post, that you can drag & drop import. It contains a macro, that lets you float text around and image, or center it.

have fun!
mario

Mat

unread,
Jun 27, 2017, 12:00:37 PM6/27/17
to TiddlyWiki
@charlyc..

If it is just horizontal centering you want, then it should be enough to do this

<center>your image</center>

<:-)

Reply all
Reply to author
Forward
0 new messages