Embedding Mastodon Posts

By default. When you embed a post from mastodon in to a WriteAs blog the default width is 400.

I am going to use the embed from my previous post as an example

<iframe src="https://mindly.social/@erinwhalen/109672470870988630/embed" class="mastodon-embed" style="max-width: 100%; border: 0" width="400" allowfullscreen="allowfullscreen"></iframe>

Changing the width to 600 results in, as you would expect a wider post which fits really nicely.

<iframe src="https://mindly.social/@erinwhalen/109672470870988630/embed" class="mastodon-embed" style="max-width: 100%; border: 0" width="600" allowfullscreen="allowfullscreen"></iframe>

We can go further and add a height element too.

<iframe src="https://mindly.social/@erinwhalen/109672470870988630/embed" class="mastodon-embed" style="max-width: 100%; border: 0" width="600" height="600" allowfullscreen="allowfullscreen"></iframe>

Which allows more of the post to be displayed.

This can, and should be adjusted for better fit, depending on size of the post being embedded.

Hope this is useful to people.

Tags

#Fediverse,#Mastodon,#WriteAs,#Embed,#Tips


MastodonPeertubeQoto sign up

Donate using Liberapay