【问题标题】::after in Internet Explorer isn't working:在 Internet Explorer 中无法正常工作之后
【发布时间】:2023-03-17 21:52:01
【问题描述】:

标题前的箭头使用 :before 显示。该问题仅出现在 Internet Explorer 上。

// 编辑:错了,我的样式在 p a 上。 也许是问题所在?

所以,这里是代码:

.special-title {
  font-size: 24px;
  color: #a4a19e;
  line-height: 1.2;
  position: relative;
  padding: 8px 0 8px 38px;
  border-top: 1px solid #e2dbcf;
  border-bottom: 1px solid #e2dbcf;
  margin-top: 49px;
  margin-bottom: 25px; }
.special-title:before {
  content: url('../img/general-title-decoration.svg?1369571463');
  position: absolute;
  width: 28px;
  left: 0;
  top: 23px;
  margin-top: -13px; }

对于按钮:

.btn-call-to-action a {
  background: #8e8287;
  color: #f5f3e2;
  padding: 2px 60px 2px 10px;
  height: 35px;
  line-height: 40px;
  margin-top: 6px;
  display: inline-block;
  position: relative;
  border-radius: 2px;
  height: 40px;
  white-space: nowrap;
  -webkit-transition: all 0.2s ease-in-out;
  -moz-transition: all 0.2s ease-in-out;
  -o-transition: all 0.2s ease-in-out;
  -ms-transition: all 0.2s ease-in-out;
  transition: all 0.2s ease-in-out; }
.btn-call-to-action a:hover:after {
  -webkit-transform: translatex(6px);
  -moz-transform: translatex(6px);
  -o-transform: translatex(6px);
  -ms-transform: translatex(6px);
  transform: translatex(6px); }
.btn-call-to-action a:hover {
  background: #6f6469;
  border-bottom: none; }
.btn-call-to-action a:after {
  content: url('../img/general-white-arrow.svg?1369574895');
  position: absolute;
  width: 35px;
  right: 15px;
  top: 0px;
  -webkit-transition: all 0.2s ease-in-out;
  -moz-transition: all 0.2s ease-in-out;
  -o-transition: all 0.2s ease-in-out;
  -ms-transition: all 0.2s ease-in-out;
  transition: all 0.2s ease-in-out; }

这是现场直播:http://aurelieremia.be/tfa/

【问题讨论】:

    标签: html css cross-browser cross-platform


    【解决方案1】:

    在.special-title:before中,由于使用的是绝对定位,去掉

    margin-top:-13px; 
    

    只使用

    top:10px; 
    

    相反。然后,声明一个高度和一个宽度。

    http://jsfiddle.net/6TdB6/

    【讨论】:

      猜你喜欢
      • 2011-07-11
      • 2013-02-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-26
      • 1970-01-01
      • 2017-05-04
      • 1970-01-01
      相关资源
      最近更新 更多