文本对齐证明IE / Edge(内联块)

时间:2016-06-08 09:10:39

标签: internet-explorer justify

我有简单的,未解决的问题,使用IE和Edge浏览器证明内联块。 Chrome,Firefox,Opera,Safari - 工作正常。

我知道有很多帖子可以解决它,但对我来说没有帮助! 我的错误是什么?

的jsfiddle:

https://jsfiddle.net/vpszLvLz/2/

HTML:

<div class="text-justify after">
  <a href="#" class="item">Left</a>
  <a href="#" class="item">Center</a>
  <a href="#" class="item">Right</a>
</div>

<div class="text-justify helper">
  <a href="#" class="item">Left</a>
  <a href="#" class="item">Center</a>
  <a href="#" class="item">Right</a>
  <div class="justify-helper"></div>
</div>

CSS:

.text-justify {
  text-align: justify;
  border: 1px dotted black;
  font-size: 0;
  line-height: 0;
  padding: 2px 3px;
}
.text-justify ~ .text-justify {
  margin-top: 30px;
}
.text-justify:after {
  display: none;
  content: "";
  width: 100%;
  height: 0;
}
.item {
  text-decoration: none;
  display: inline-block;
  vertical-align: middle;
  background-color: coral;
  line-height: normal;
  color: white;
  padding: 4px 8px;
  font-size: 20px;
}
.justify-helper {
  visibility: hidden;
  display: none;
  width: 100%;
  height: 0;
}
.text-justify.helper .item {
  background-color: darkturquoise;
}
.text-justify.after:after {
  display: inline-block;
}
.text-justify.helper .justify-helper {
  display: inline-block;
}

0 个答案:

没有答案