Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding space between text and image in Markdown

In Markdown, you add an image as

![myimg](link)

Now, I can easily change the size and placement of said image using attributes as

![myimg](link){: height="75px" width="300px" align="left"}

How do I also make it so that there is also a (choosable) space between image and text? Parameters like border don't work.

Using Kramdown as converter, on Github pages, if that matters.

like image 583
mar tin Avatar asked Jan 06 '17 21:01

mar tin


People also ask

How do you put space between pictures and text?

Usually, it is preferable to have a little space between the image and the surrounding text. In HTML, you provide this space by using the vspace and hspace attributes within the img element. In CSS, to align an element with no text wrap, apply the text-align property to a block-level element that contains the image.

How do you add a space in markdown?

Blank Lines To add a single extra line after a paragraph, add two extra spaces at the end of the text. To add an extra line of space between paragraphs, add the HTML   code, followed by two extra spaces (e.g. &nbsp.. , replacing the periods with spaces).

How do you put a space between words in markdown?

You have to use the   for it.

How to add width and height to an image in Markdown?

It generates and displays an image. There is no support for markdown standard syntax for adding width. You can use a plain img tag which works as expected in markdown pages. You can also add height using the same img tag. It is extended markdown syntax available for changing height and width.

How to add indentation to Markdown text lines?

Sometimes, We want to add indentation to markdown text lines. By default, markdown ignores blank spaces. It includes adding space to the paragraph first line Add tab space to markdown text lines. How to indent a few lines in markdown? normal Text content one indented Text content one indented more Text content one

How to add captions to an image using Markdown?

You can also use the rudimentary HTML paragraph <p> tag to add captions as well. In this case, you might want to use the align = "center" attribute to center the captions of the image. The above code results as shown below. Well, that’s it for this short tutorial for adding captions to an image using Markdown.

What is Markdown markup?

Markdown is a lightweight markup language with plain text formatting syntax. It is designed so that it can be converted to HTML and many other formats using a tool by the same name. eg. If you want to add 10 spaces contiguously then you should use space space space space space


2 Answers

Markdown is not capable of designing layouts like this. You can use multiple non-breaking spaces (&nbsp;) to adjust the spacing between an image and text.

Example:

![image](link)&nbsp;&nbsp;&nbsp;&nbsp;text

Result:

    text

like image 143
Tamás Sengel Avatar answered Oct 16 '22 11:10

Tamás Sengel


For this to work for me for the paragraph of text next to the image, I used this:

![myimg](link){: height="75px" width="300px" style="float:left; padding-right:10px" }
like image 21
MethodMan Avatar answered Oct 16 '22 11:10

MethodMan