Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Content & Markdown

Float an image left

Started by Norma White 9 years ago · 6 replies · 11027 views
9 years ago

Is there any extension in the md image syntax to float a picture to the left?
If not, how can we do this with HTML?

From the suggested archive I am trying this


Church of living hope {.float-left} We rent space at the Church of Living Hope for our rehearsals. We have the use of two large rooms, as well as a storage room forour percussion instruments. The church is located at 1, Consumers Drive, off Lansdowne, next to the OPP Offices, and across from the shopping centre on Landsdowne East.


But I just get the picture with one line beside it and the rest below
And the line starts with {.float-left}

Thanks

Norma

9 years ago

You don't need markdown extra, in fact I would recommend not using it as it causes some other markdown bugs.

9 years ago

Are you sure? When I disable Markdown Extra {.fl} and {fr} do not work and get displayed as text

9 years ago

Did you read the link I posted?

![My Image](my-image.jpg?classes=float-left)

last edited 08/23/17 by arank
9 years ago

As @arank said, this can be achieved without extended markdown. It may also be necessary to clear the float after each block, the following works for me:

CSS:

CSS
/*add classes for image location*/
img.float-left {display:inline; float:left; margin:5px 15px 5px 0; max-width: 47%;}
img.float-right {float:right; margin:5px 0 5px 15px; max-width: 47%;}
img.aligncenter {display:block; margin:10px auto;}
img.border {background:#ccc; border:4px solid #f0f0f0; color:#333; padding:1px;}

A page of mardown with HTML special sauce

HTML
---
title: FLOATS
---

##Floats

![](leftfloat.jpg?classes=float-left)

### Blah Blah 

text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

<div style="clear: both;"></div>

![](rightfloat.jpg?classes=float-right)

### Blah Blah 

text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

<div style="clear: both;"></div>

![](leftfloat2.jpg?classes=float-left)

### Blah Blah 

text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Jochen, 8 months ago
6 94 8 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 184 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 146 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 60 1 year ago
Content & Markdown · by belthasar, 1 year ago
4 254 1 year ago