Float right and left are on the same line

mlwacosmos

The first image and the file label are on the same line, but the last image is on a second line.

I would like the three items to be on the same line.

Here is my code:

HTML:

<div>
      <img src="{{asset('bundles/cramifaccueil/images/pdfdocument.png')}}"  
                         title="{% trans %}dialog.pdf.file{% endtrans %}"
                         class="smallImagesFloatLeft"
                         />
      <div class="fileLabel">{% trans %}file.note.service.2584{% endtrans %}</div>
      <img src="{{asset('bundles/cramifaccueil/images/download.png')}}" 
                        title="{% trans %}download{% endtrans %}"
                        class="smallImagesFloatRight"
                        />
</div>
<div>
      <img src="{{asset('bundles/cramifaccueil/images/pdfdocument.png')}}" 
                        title="{% trans %}dialog.pdf.file{% endtrans %}"
                        class="smallImagesFloatLeft"
                        />
      <div class="fileLabel">{% trans %}file.mode.operatoire{% endtrans %}</div>
      <img src="{{asset('bundles/cramifaccueil/images/download.png')}}" 
                        title="{% trans %}download{% endtrans %}"
                        class="smallImagesFloatRight"
                        />
</div>

CSS:

.smallImagesFloatLeft {
  float:left;
  margin-right:5px;
  cursor: default;
}

.smallImagesFloatRight{
  float:right;
}

.fileLabel {
 max-width: 75%;
}
James Montagne

Assuming there is room on one line, you simply need to re-order your elements so that the floats come before the non-floated element:

<div>
      <img src="{{asset('bundles/cramifaccueil/images/pdfdocument.png')}}"  
                         title="{% trans %}dialog.pdf.file{% endtrans %}"
                         class="smallImagesFloatLeft"
                         />
     <img src="{{asset('bundles/cramifaccueil/images/download.png')}}" 
                        title="{% trans %}download{% endtrans %}"
                        class="smallImagesFloatRight"
                        />
     <div class="fileLabel">{% trans %}file.note.service.2584{% endtrans %}</div>
</div>

http://jsfiddle.net/o0ksu724/

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Float left and right in same UL

From Dev

Left and right align on same line

From Dev

CSS - Float: left on the same line

From Dev

Float right on 2 spans of same line, but need first span to be on left side

From Dev

IOS Multiple right and left align on same line

From Dev

Align text to the left and right on the same line with CSS

From Dev

HTML align text left and right on same line

From Dev

Invertified Right and Left Justify On Same Line

From Dev

Issues aligning elements left and right on same line

From Dev

Position elements left and right on same line, or both left if not enough space

From Dev

CSS Float Left and then Right

From Dev

python docx align both left and right on same line

From Dev

How do I align text left and image right on the same line?

From Dev

CSS: align two element, to the left and right in the same line WHITHOUT floats

From Dev

how to display image on left and paragraph on right on the same line

From Dev

Left- and right-aligned text on the same line in a Bootstrap dropdown

From Dev

How to align two paragraphs to the left and right on the same line?

From Dev

Word formatting - Align left, center, and right in same line

From Dev

Having some text align left and other align right, in same line

From Dev

Aligning text on same line ignoring space from left and right

From Dev

how to put float: right; Font Awesome icon on same line?

From Dev

Multiple divs on same line without using float:left on each element

From Dev

Margin left and right not the same

From Dev

Bootstrap float divs left to right

From Dev

Float logo to the left, and content to the right

From Dev

Stack Float the TextView in Left and Right

From Dev

CSS: Difference between float:left and float:right

From Dev

Clearfix not working with float: left and float: right in <ol>

From Dev

css Float left and Float right issue

Related Related

  1. 1

    Float left and right in same UL

  2. 2

    Left and right align on same line

  3. 3

    CSS - Float: left on the same line

  4. 4

    Float right on 2 spans of same line, but need first span to be on left side

  5. 5

    IOS Multiple right and left align on same line

  6. 6

    Align text to the left and right on the same line with CSS

  7. 7

    HTML align text left and right on same line

  8. 8

    Invertified Right and Left Justify On Same Line

  9. 9

    Issues aligning elements left and right on same line

  10. 10

    Position elements left and right on same line, or both left if not enough space

  11. 11

    CSS Float Left and then Right

  12. 12

    python docx align both left and right on same line

  13. 13

    How do I align text left and image right on the same line?

  14. 14

    CSS: align two element, to the left and right in the same line WHITHOUT floats

  15. 15

    how to display image on left and paragraph on right on the same line

  16. 16

    Left- and right-aligned text on the same line in a Bootstrap dropdown

  17. 17

    How to align two paragraphs to the left and right on the same line?

  18. 18

    Word formatting - Align left, center, and right in same line

  19. 19

    Having some text align left and other align right, in same line

  20. 20

    Aligning text on same line ignoring space from left and right

  21. 21

    how to put float: right; Font Awesome icon on same line?

  22. 22

    Multiple divs on same line without using float:left on each element

  23. 23

    Margin left and right not the same

  24. 24

    Bootstrap float divs left to right

  25. 25

    Float logo to the left, and content to the right

  26. 26

    Stack Float the TextView in Left and Right

  27. 27

    CSS: Difference between float:left and float:right

  28. 28

    Clearfix not working with float: left and float: right in <ol>

  29. 29

    css Float left and Float right issue

HotTag

Archive