【问题标题】:How to fix the negative position value on div?如何修复div上的负位置值?
【发布时间】:2018-03-13 18:30:32
【问题描述】:

请看下面的片段图片

我创建了一个包含 position:fixed; 的 div,并注意到左侧有一个空白区域被 position 15 占用,我第一次看到它。如何修复它。

如何将position改为0。

<div class="nav-color" style="position:fixed; z-index: 5; bottom: 0; padding: 10px; background-color: blue; " class="col-md-12">
  <input type="text" class="form-control col-md-6" placeholder="Type Here" style="margin-right: 10px;" />
  <span class="input-group-btn col-md-6">
		      <button class="btn btn-default " type="button" style=" margin-left: 10px;margin-right: 10px;">Add</button>
		      <button class="btn btn-warning " style="color: white;">Logout</button>
		    </span>
</div>

【问题讨论】:

  • 您需要在此处发布您的标记示例:minimal reproducible example
  • 感谢回复,我通过添加left:0;right:0;解决了这个问题
  • 您需要将其写成您问题的答案,而不仅仅是发表评论。

标签: html css angular


【解决方案1】:

我注意到只是通过使bottom:0; 整个元素粘在底部,我添加了left:0; 并将位置更正到左侧。 根据差距在哪一侧提供价值。 left:0;right:0;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-18
    • 2021-01-14
    • 2018-12-31
    相关资源
    最近更新 更多