Right Side align without float

后端 未结 3 2034
谎友^
谎友^ 2021-02-18 17:00

I have a chat widget that I am adding some styling to. However I am having difficulty making the \"user\" chat bubbles align to the right of the screen.

When I use floa

3条回答
  •  悲哀的现实
    2021-02-18 17:44

    You can use float:right on the user messages and put a clearfix div after each one:

    http://jsbin.com/utulay/2/edit

    I have a question about kittens?

    CSS

    .clearfix:after {
        clear: both;
        content: ".";
        display: block;
        height: 0;
        visibility: hidden;
    }
    .clearfix {
        display: inline-block;
    }
    .clearfix {
        display: block;
    }
    

提交回复
热议问题