Inline-block line-wrap extra space

前端 未结 4 1920
无人及你
无人及你 2020-12-14 19:15

I\'ve got an inline-block element that contains a very long word. When I resize the viewport until I reach the breakpoint of the text wrapping to the next line, I get a subs

4条回答
  •  一个人的身影
    2020-12-14 19:56

    If im understanding you correctly you could use the @media type to decide what css to use depending on the width of the screen

    here is an example of what i mean

    @media(min-width:0px) and (max-width:200px){
        div {
        display: block;
        background-color: black;
        color: white;
        padding: 5px;
        }
    }
    @media (min-width:200px){
        div {
        display: inline-block;
        background-color: black;
        color: white;
        padding: 5px;
        }
    }
    

提交回复
热议问题