【问题标题】:How can I inline this progressbar to function for gmail?如何内联此进度条以用于 gmail?
【发布时间】:2018-07-20 18:44:54
【问题描述】:

我有一个进度条的代码(下面的 sn-p),我不确定如何进行内联。我已经为模板的其余部分内联了我的 CSS 的其余部分,该进度条将在其中找到,因为它就像在 <div> 中包含“样式”一样简单。

但是,由于 gmail 会立即从 <head> 中删除 <style>,而且我没有看到像 .done.after 这样的类的任何属性,所以我不完全确定如何在此处继续。

我将不胜感激有关此问题的任何帮助、正确做法的指针或可以进一步教育我的资源。

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.container {
  width: 700px;
  margin: 100px auto;
}

.progressbar {
  counter-reset: step;
}

.progressbar li {
  /*name of incomplete tasks */
  list-style-type: none;
  width: 20%;
  float: left;
  font-size: 12px;
  font-family: sans-serif;
  position: relative;
  text-align: center;
  color: #7d7d7d;
}

.progressbar li:before {
  /*circle of incomplete tasks */
  width: 20px;
  height: 20px;
  content: "";
  counter-increment: step;
  line-height: 20px;
  border: 2px solid #7d7d7d;
  display: block;
  text-align: center;
  margin: 0 auto 5px auto;
  border-radius: 50%;
  background-color: white;
  position: relative; /* ---------------- Added */
  z-index: 1; /* ------------------------ Added */
}

.progressbar li:after {
  /* line preceding incomplete tasks */
  width: 100%;
  height: 2px;
  content: '';
  position: absolute;
  background-color: #7d7d7d;
  top: 12px;
  left: -50%;
}

.progressbar li:first-child:after {
  content: none;
}

.progressbar li.done {
  /* check mark and name of completed tasks */
  color: #55b776;
}

.progressbar li.done:before {
  /* circles of completed tasks */
  border-color: #55b776;
  content: "\2713";
}

.progressbar li.done+li:after {
  /* line following completed tasks */
  background-color: #55b776;
}
</style>
</head>
  <table width="95%" align="center" cellpadding="10" style="width:95%;background-color:white;">
    <tbody>
      <tr>
        <td align="center" style="text-align: center;">
          <span class="container">
            <ul class="progressbar">
              <li class="done">Open</li>
              <li class="done">In Progress</li>
              <li>With Engineering</li>
              <li>Resolution Provided</li>
              <li>Closed</li>
            </ul>
          </span>
        </td>
      </tr>
       </tbody>
     </table>
   </div>
</html>

【问题讨论】:

    标签: html css progress-bar


    【解决方案1】:

    我很确定 gmail 不支持伪元素,例如 :before 和 :after。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-02-28
      • 1970-01-01
      • 1970-01-01
      • 2010-10-18
      • 1970-01-01
      • 2020-02-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多