ANKI CSS / HTML:如何以固定位置在审阅中显示标签而不会重叠?

问题描述

我正在设计我的ANKI卡,使标签在审阅时可见,我希望它们位于右下角的固定位置,但它们彼此重叠。 How the cards look with tags in position: fixed

这是卡片的“样式”部分的代码

/* TAGS */
/* Clickable Tags (need to download the add-on) */
kbd {
position: fixed;
right: 0;
bottom: 0;
  display: inline-block;
  letter-spacing: .2px;
  font-weight: bold;
  font-size: 16px !important;
  text-shadow: none !important;
  padding: 0.05rem 0.1rem !important;
  margin: 1px !important;
  border-radius: 4px;
  border-width: 1.5px !important;
  border-style: solid;
  background-color: transparent !important;
  Box-shadow: none !important;
  opacity: 0.5;
  vertical-align: right;
   word-break: break-all;

}

/* Tag Becomes More Visible On Hover */
kbd:hover { opacity: 1; transition: opacity 0.2s ease; }

/* Tag Colors */
kbd:nth-of-type(1n+0) { border-color: #fc00ff; color: #fc00ff; }
kbd:nth-of-type(2n+0) { border-color: #03A9F4; color: #03A9F4; }
kbd:nth-of-type(3n+0) { border-color: #FF0000; color: #FF0000; }
kbd:nth-of-type(4n+0) { border-color: #faed27; color: #faed27; }
kbd:nth-of-type(5n+0) { border-color: #FF9933; color: #FF9933}
kbd:nth-of-type(6n+0) { border-color: #ff6ec7; color: #ff6ec7; }
kbd:nth-of-type(7n+0) { border-color: #8ffcff; color: #8ffcff; }
kbd:nth-of-type(8n+0) { border-color: #ff009a; color: #ff009a; }
kbd:nth-of-type(9n+0)  { border-color: #39ff14; color: #39ff14; }
kbd:nth-of-type(10n+0) { border-color: #1b03a3; color: #1b03a3; }

/* Tag Mobile Adjustments */
.mobile kbd { opacity: .9; margin: 1px !important; display: inline-block; font-size: 14px !important; }
.mobile #tags-container {line-height:0.6rem; margin-left: 0px; }

这是卡的“正面”部分的代码

{{#Tags}}
<br id= mobilebr>
<div style="Text-align: Right"><div id="tags-container">{{Tags}}</div>
<script>
  var tagContainer = document.getElementById("tags-container")
  if (tagContainer.childElementCount == 0) {
    var tagList= tagContainer.innerHTML.split(" ");
    var kbdList = [];
    var newTagContent = document.createElement("div");

    for (var i = 0; i < tagList.length;  i++) {
      var newTag = document.createElement("kbd");
      newTag.innerHTML = tagList[i];
      newTagContent.append(newTag)
    }
    tagContainer.innerHTML = newTagContent.innerHTML;
    tagContainer.style.cursor = "default";
  }
</script>
{{/Tags}}

我对HTML / CSS缺乏经验,所以如果问题很简单或代码很混乱,我深表歉意。让我知道是否可以澄清任何事情。谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...