Skip to content

Instantly share code, notes, and snippets.

@liuyanghejerry
Forked from anonymous/index.html
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liuyanghejerry/f14207c4fdf85fce4030 to your computer and use it in GitHub Desktop.
Save liuyanghejerry/f14207c4fdf85fce4030 to your computer and use it in GitHub Desktop.
文字等宽对齐demo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
ul {
width: 180px;
}
li {
width: 100%;
text-align: justify;
list-style: none;
}
li::after {
display: inline-block;
content: '';
overflow: hidden;
width: 100%;
height: 0;
}
</style>
</head>
<body>
<ul>
<li>这是比较长的一个设置</li>
<li>设置</li>
<li>中等长度的设置</li>
</ul>
<script id="jsbin-source-css" type="text/css">ul {
width: 180px;
}
li {
width: 100%;
text-align: justify;
list-style: none;
}
li::after {
display: inline-block;
content: '';
overflow: hidden;
width: 100%;
height: 0;
}</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment