# How to float one image one way and another the other way?

**URL:** https://forum.code.org/t/how-to-float-one-image-one-way-and-another-the-other-way/36945
**Category:** CS Discoveries
**Tags:** csd-unit-2
**Created:** [September 22, 2022, 3:00pm UTC](https://forum.code.org/t/how-to-float-one-image-one-way-and-another-the-other-way/36945 "2022-09-22T15:00:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![GordonBrune](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/gordonbrune/32/4752_2.png) [@GordonBrune](https://forum.code.org/u/GordonBrune)
#### Post date: [September 22, 2022, 3:00pm UTC](https://forum.code.org/t/how-to-float-one-image-one-way-and-another-the-other-way/36945/1 "2022-09-22T15:00:40Z")

</div>

A student wants to float one image to the left and the other to the right. He removes the float rule set from the style sheet and puts float code in the html tags for each image but doesn’t work. Any ideas?  
[https://codeprojects.org/projects/weblab/Mz\_U0FsaN9UC6ueNd6MS\_gUmNHzMedjSM-bn7\_CHRXA](https://codeprojects.org/projects/weblab/Mz_U0FsaN9UC6ueNd6MS_gUmNHzMedjSM-bn7_CHRXA)

---

<div class="post-metadata">

### Author: ![mwood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mwood/32/4941_2.png) [@mwood](https://forum.code.org/u/mwood)
#### Post date: [September 22, 2022, 3:36pm UTC](https://forum.code.org/t/how-to-float-one-image-one-way-and-another-the-other-way/36945/2 "2022-09-22T15:36:14Z")

</div>

@GordonBrune ,

They could accomplish that by using [classes](https://studio.code.org/docs/concepts/css/classes/) in their html document and then styling the classes on the css page, however, if you use the inline styling like they are trying to do, they would remove the float from the css page first. Then, float isn’t an html attribute, so in the html, they would have to do something like this using a style attribute.

`<img src="Yankeestwo.png" alt="Image description" width="150" height="150" style="float:left">`

Good luck!

Mike
