【问题标题】:How I Do Dynamic Size box我如何做动态尺寸框
【发布时间】:2019-05-26 17:51:02
【问题描述】:

我有一个盒子,当我选择某个东西时,我想在那里看到我的选择(比如购物车)。 我希望盒子是动态的,这意味着盒子里不会有文字溢出(没有文字向下溢出)

HTML

<div class="box-s">
  <p  style="text-align: left; width:49%; display: inline-block;">{{mealService.getName()}}</p>
  <p  style="text-align: right; width:49%; display: inline-block;">{{mealService.getPrice()}}$</p>

CSS

.box-s{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 300px;
  height: 350px;
  background: #fff;
  color: #9e9e9e;
  margin: 0 auto;
  margin-bottom: 20px;
  text-align: center;
  line-height: 35px;
  font-family: "Forte";
  font-size: 20px;
}

谢谢:)

【问题讨论】:

  • 您能说清楚您希望我们为您提供哪些帮助吗?
  • 它的工作,但我有文本从框按钮变形,我希望所有的 txet 都将在框中动态

标签: html css angular angular-ui-bootstrap


【解决方案1】:

我的解决方案是在css文件中需要将高度更改为最小高度

.box-s{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 300px;
  min-height: 350px;
  background: #fff;
  color: #9e9e9e;
  margin: 0 auto;
  margin-bottom: 20px;
  text-align: center;
  line-height: 35px;
  font-family: "Forte";
  font-size: 20px;
}

【讨论】:

    猜你喜欢
    • 2021-02-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-02
    • 2021-11-06
    • 2012-02-29
    • 1970-01-01
    相关资源
    最近更新 更多