我如何修复元素

时间:2016-05-30 07:08:50

标签: html css web

如何在div块上修复计数文本?更改屏幕尺寸时出现问题。

正常

enter image description here

在屏幕上调整大小

enter image description here

守则:



span.right-corner{
  position: relative;  
  float: left; 
  left: 250px;  
  bottom: 25px;  
  width: auto;  
}
div.top-block{
  position: relative; 
  float: left; 
  left: 240px;
  bottom: 40px; 
  width: auto; 
}

<div class="col-sm-4">
  <div class="top-block">
    <div class="huge"><i class="fa fa-book"></i></div>
  </div>
  <div class="well">
    <span class="badge right-corner">${count}</span>
    <h4>Архів</h4>
    <a class="watcher" href="/edocs/main/archive/${offnoteType}"></a>
  </div>
</div>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:1)

下次请粘贴一个正常工作的代码,以便我们帮助您。

Check this solution

而不是使用浮动(我不推荐......仅针对少数特定情况) 我认为对于你的情况来说,相对和绝对的位置更容易。

调整大小并查看&#34;通知&#34; block总是在他的容器右上角。

  • position: relative

  • 绝对子容器:position: absolute; right: 0; top: 0;

现在你只需要使用填充来实现良好的设计。

提示:如果使用语义html而不是1048105715 div,会更好;)