锚中的FontAwesome图标更适合内容

布莱恩·古根海默

我试图在列表项的右侧有两个可单击的图标。但是,由于某些原因,包含图标的锚点会延伸得很宽(没有填充或边距),从而使单击区域重叠。

这是我的字体图标问题吗?还是我找不到其他问题。

jsfiddle:https ://jsfiddle.net/mg6d8s75/1/

HTML:

<ul class="list-group ui-sortable" id="todolist">
  <li class="ui-sortable-handle">
    <div class="prettycheckbox">
      <div class="prettycheckbox-success">
        <input class="todocheckbox" type="checkbox" id="checkbox336" aria-label="...">
        <label for="checkbox336">
          <span>I'm a task!</span>
          <a href="#notification-modal" id="notification336" class="notification-button pull-right" data-toggle="modal" data-task-id="336" data-due-date="1111-11-11">
            <span><i class="fa fa-bell-o" aria-hidden="true"></i></span>
          </a>
          <a href="" class="deletebutton pull-right" id="delete336">
            <span><i class="fa fa-times" aria-hidden="true"></i></span>
          </a>
        </label>
      </div>
    </div>
  </li>
</ul>

CSS:

.deletebutton {
  top: 10px;
  right: 10px;
  position: absolute;
}

.notification-button {
  top: 10px;
  right: 30px;
  position: absolute;
}

/* TodoList Checkboxes */

.prettycheckbox input[type="checkbox"]:hover:not(:checked) ~ label {
  color: #888;
}

.prettycheckbox input[type="checkbox"]:hover:not(:checked) ~ label:before {
  content: '\2714';
  text-indent: .9em;
  color: #C2C2C2;
}

.prettycheckbox div {
  clear: both;
  overflow: hidden;
}

.prettycheckbox label {
  width: 100%;
  border-radius: 3px;
  border: 1px solid #D1D3D4;
  font-weight: normal;
}

.prettycheckbox input[type="checkbox"]:empty {
  display: none;
}

.prettycheckbox input[type="checkbox"]:empty ~ label {
  position: relative;
  line-height: 2.5em;
  text-indent: 3.25em;
  margin-top: 1px;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}

.prettycheckbox input[type="checkbox"]:empty ~ label:before {
  position: absolute;
  display: block;
  top: 0;
  bottom: 0;
  left: 0;
  content: '';
  width: 2.5em;
  background: #D1D3D4;
  border-radius: 3px 0 0 3px;
}

.prettycheckbox input[type="checkbox"]:checked ~ label {
  color: #31B44A;
}

.prettycheckbox input[type="checkbox"]:checked ~ label:before {
  content: '\2714';
  text-indent: .9em;
  color: #333;
  background-color: #ccc;
}

.prettycheckbox input[type="checkbox"]:focus ~ label:before {
  box-shadow: 0 0 0 3px #999;
}

.prettycheckbox-success input[type="checkbox"]:checked ~ label:before {
  color: #fff;
  background-color: #5cb85c;
}

#todolist > li {
    display:inline;
}
诺斯基

从您的标签中删除链接,它似乎可以解决问题

<ul class="list-group ui-sortable" id="todolist">
  <li class="ui-sortable-handle">
    <div class="prettycheckbox">
      <div class="prettycheckbox-success">
        <input class="todocheckbox" type="checkbox" id="checkbox336" aria-label="...">
        <label for="checkbox336">
          <span>I'm a task!</span>
        </label>
        <a href="#notification-modal" id="notification336" class="notification-button pull-right" data-toggle="modal" data-task-id="336" data-due-date="1111-11-11">
          <i class="fa fa-bell-o" aria-hidden="true"></i>
        </a>
        <a href="" class="deletebutton pull-right" id="delete336">
          <i class="fa fa-times" aria-hidden="true"></i>
        </a>
      </div>
    </div>
  </li>
</ul>

我还删除了跨度,因为它们是不必要的。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

CSS内容中的FontAwesome图标

来自分类Dev

CSS内容中的FontAwesome图标

来自分类Dev

Fontawesome中的堆栈图标

来自分类Dev

Fontawesome中的堆栈图标

来自分类Dev

在保持 FontAwesome 图标内联的同时更改锚文本

来自分类Dev

为什么`with open()`更适合在Python中打开文件?

来自分类Dev

为什么`with open()`更适合在Python中打开文件?

来自分类Dev

哪个查询更适合分页?

来自分类Dev

哪个更适合日志分析

来自分类Dev

什么更适合保存列表?

来自分类Dev

某些Fontawesome图标未在Safari中显示

来自分类Dev

Safari中的FontAwesome图标比Chrome高

来自分类Dev

Fontawesome图标未显示在Android应用中

来自分类Dev

slideToggle中的fontawesome图标上的slideUp

来自分类Dev

更改FontAwesome和Angular 10中的图标

来自分类Dev

无法在FontAwesome React中显示检查图标

来自分类Dev

某些Fontawesome图标未在Safari中显示

来自分类Dev

在bash promt中设置FontAwesome图标

来自分类Dev

MYSql:哪一个更适合获得ROWS?(在IN()中)或foreach

来自分类Dev

哪种方法更适合在sql server中查找最大值?

来自分类Dev

调整图标大小以适合Java中的JButton?

来自分类Dev

CSS - 将 FontAwesome 图标与文本输入中的图标对齐

来自分类Dev

LTS与非LTS哪个更适合我?

来自分类Dev

与Map相比,何时更适合使用Set?

来自分类Dev

i ++或++ i更适合此程序吗?

来自分类Dev

几何平滑:使曲线更适合点

来自分类Dev

LTS与非LTS哪个更适合我?

来自分类Dev

只是调查哪个平台更适合使用

来自分类Dev

哪种文件系统更适合Ceph?