Title: Floating a block
Last modified: March 15, 2020

---

# Floating a block

 *  Resolved [philgreen](https://wordpress.org/support/users/philgreen/)
 * (@philgreen)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/floating-a-block/)
 * I created a block that is to be an inset box floated inside of a block of text,
   the way that align-right works for images.
 * I can put “float:right” on the div, and that works, but now I can’t click on 
   the block to select in the editor. Is there some way built into wordpress to 
   float non-image blocks like this custom block?
    -  This topic was modified 6 years, 2 months ago by [philgreen](https://wordpress.org/support/users/philgreen/).
    -  This topic was modified 6 years, 2 months ago by [philgreen](https://wordpress.org/support/users/philgreen/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Ryan Kienstra](https://wordpress.org/support/users/ryankienstra/)
 * (@ryankienstra)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/floating-a-block/#post-12546689)
 * Hi [@philgreen](https://wordpress.org/support/users/philgreen/),
    Maybe you know
   about this, but there’s a way to add a CSS class and get it in the template with`
   block_value( 'className' )`
 * [https://cldup.com/sPm-cAeECd.png](https://cldup.com/sPm-cAeECd.png)
 * Then, maybe you could add styling floating that.
 * Is that what you had in mind?
    -  This reply was modified 6 years, 2 months ago by [Ryan Kienstra](https://wordpress.org/support/users/ryankienstra/).
 *  Thread Starter [philgreen](https://wordpress.org/support/users/philgreen/)
 * (@philgreen)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/floating-a-block/#post-12546792)
 * No that’s not what I mean, sorry. I have float:right in the template. It looks
   something like this:
 * <style>
    .inset-box{border:1px solid #cccccc;width:400;float:right;margin:0 0
   2em 2em;} </style> <div class=”inset-box”> <p><?php block_field( ‘text’ ); ?>
   </p> </div>
 * When I add it to the editor, it floats properly into the paragraph block that’s
   underneath and displays properly. The problem is that I can’t click on it in 
   the editor. What am I doing wrong?
 *  Plugin Author [Ryan Kienstra](https://wordpress.org/support/users/ryankienstra/)
 * (@ryankienstra)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/floating-a-block/#post-12554843)
 * Hi [@philgreen](https://wordpress.org/support/users/philgreen/),
    Sorry for the
   delay.
 * Maybe this is just from copying it, but could you please try replacing backticks
   with single quotes in `block_field( 'text' )`
 * For example, right now, it’s using backticks:
 * `block_field( ‘text’ )`
 *  Plugin Author [Ryan Kienstra](https://wordpress.org/support/users/ryankienstra/)
 * (@ryankienstra)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/floating-a-block/#post-12566978)
 * Closing, but feel free to comment if that didn’t help. Have a great weekend.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Floating a block’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/block-lab_5c34e8.svg)
 * [Block Lab](https://wordpress.org/plugins/block-lab/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/block-lab/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/block-lab/)
 * [Active Topics](https://wordpress.org/support/plugin/block-lab/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/block-lab/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/block-lab/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Ryan Kienstra](https://wordpress.org/support/users/ryankienstra/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/floating-a-block/#post-12566978)
 * Status: resolved