【发布时间】:2016-06-24 14:02:11
【问题描述】:
我想知道如何在单词后添加制表符空格。显示的输出是我目前拥有的。但是我想这样做,即使泰语这个词比粤语这个词短,我希望它们后面的圆圈从同一点开始,这样看起来会更有条理。 下面是我生成语言的 php 代码,可以是“泰语”、“英语”等,如果语言水平熟练,它将显示 1 个圆圈,依此类推。
for($a = 0; $a < $count; $a++)
{
$b = $languagelevel[$a][0];
echo $b;
if($languagelevel[$a][1] == "Proficient")
{
for($i = 0; $i < 1; $i++)
{
echo "<div class='language1'></div>";
}
}
else if($languagelevel[$a][1] == "Good")
{
for($i = 0; $i < 2; $i++)
{
echo "<div class='language2'></div>";
}
}
else if($languagelevel[$a][1] == "Very Good")
{
for($i = 0; $i < 3; $i++)
{
echo "<div class='language3'></div>";
}
}
else
{
for($i = 0; $i < 4; $i++)
{
echo "<div class='language3'></div>";
}
}
echo "<br>";
}
以下是我的圆圈 css 代码。
.language1
{
border-radius: 50%;
width: 15px;
height: 15px;
padding: 3px;
display:inline-block;
background-color: red;
border: 2px solid #666;
margin-left: 5px;
font: 20px Arial, sans-serif;
}
.language2
{
border-radius: 50%;
width: 15px;
height: 15px;
padding: 3px;
display:inline-block;
background-color: orange;
border: 2px solid #666;
margin-left: 5px;
font: 20px Arial, sans-serif;
}
.language3
{
border-radius: 50%;
width: 15px;
height: 15px;
padding: 3px;
display:inline-block;
background-color: green;
border: 2px solid #666;
margin-left: 5px;
font: 20px Arial, sans-serif;
}
【问题讨论】:
-
我们需要查看输出的 HTML
标签: php css whitespace