Prevent a specific child div from expanding the parent div

前端 未结 2 499
傲寒
傲寒 2020-12-29 17:59

I\'m currently developping a website and encountered a problem with CSS.

I have a parent div containing 2 or more children: one containing the name of a

2条回答
  •  旧时难觅i
    2020-12-29 18:45

    If you add the following styles you should achieve what you want:

    .user-match-container {
      position: relative;
      padding-top: 22px;
    }
    
    .match-owner {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      position: absolute;
      top: 4px;
      left: 0;
      right: 0;
    }
    

    Example

提交回复
热议问题