在html中添加文本之间的间距

时间:2017-01-14 15:40:38

标签: html css

我只是试图将所有接触对齐在一条整齐的直线上,以便它按顺序查看。它的代码是什么? div上的外观是我想要完成的。图像是问题所在。

编辑:我不想使用 ,因为每次我想添加空格时都必须放置它。

[HTML]

<div class="col-md-6 services-margin">
    <img class="flagsize" src="../../../img/flag_brunei.png">
    <div class="services">
        <p class="country-title">Brunei</p>
        <p>Ambulance         :991</p>
        <p>Police            :993</p>
        <p>Fire and Rescue   :995</p>
        <p>Search and Rescue :998</p>
    </div>
</div>

[CSS]

.services-margin {
    margin-bottom: 25px;
}

.country-title {
    font-weight: bold;
    font-size: 15px;
}

.flagsize {
    width: 40%;
    float: left;
    height: 140px;
    width: 250px;
    margin-right: 10px;

}

.services {
    float: left;
}

enter image description here

6 个答案:

答案 0 :(得分:0)

您可以使用

  

&amp; nbsp;

创建单个空格或根据需要重复它,但更好的解决方案是为文本添加填充  尝试

gulp.task('gulp-uglify' , function(){

    gulp.src('simple.js')
    .pipe( uglify() ) //no need to buffer()
    .pipe( gulp.dest('./scripts'));
});

答案 1 :(得分:0)

只需使用表格:

		.services-margin {
    margin-bottom: 25px;
}

.country-title {
    font-weight: bold;
    font-size: 15px;
}

.flagsize {
    width: 40%;
    float: left;
		clear: both;
    height: 140px;
    width: 250px;
    margin-right: 10px;

}
	 <div class="col-md-6 services-margin">
                <img class="flagsize" src="../../../img/flag_brunei.png">
                <div class="services">
								<table>
									<tr>
										<td>Ambulance</td><td>991</td>
									</tr>
									<tr>
										<td>Police</td><td>993</td
										</tr>
								</table>
                </div>
    </div>

答案 2 :(得分:0)

尝试向.services添加一些左边距或填充:

.services {
  padding-left: 15px; /* any value you like */
}

答案 3 :(得分:0)

预标记可用于保留空格和换行符。我希望这就是你要找的 -

<pre>
This will detect    all   spaces and
line
breaks.
</pre>

答案 4 :(得分:0)

你不想乱搞添加空格等,你需要用造型来做这一切。您可以将类放在要对齐的文本位上,如下所示:

&#13;
&#13;
.services-margin {
    margin-bottom: 25px;
}

.country-title {
    font-weight: bold;
    font-size: 15px;
}

.flagsize {
    width: 40%;
    float: left;
    height: 140px;
    width: 250px;
    margin-right: 10px;

}

.services {
    float: left;
}

.contact{
  float:right;
}
&#13;
<div class="col-md-6 services-margin">
                <img class="flagsize" src="../../../img/flag_brunei.png">
                <div class="services">
                    <p class="country-title">Brunei</p>
                    <p>Ambulance:<span class="contact">991</span></p>
                  <p>Police:<span class="contact">993</span></p>
                  <p>Fire and Rescue:<span class="contact">995</span></p>
                  <p>Search and Rescue:<span class="contact">998</span></p>
         
                </div>
    </div>
&#13;
&#13;
&#13;

答案 5 :(得分:0)

#include <fstream> #include <string> int main() { std::fstream file("test.txt", std::ios::in | std::ios::out | std::ios::binary); std::string s; file >> s; // get current read position auto read_pos = file.tellg(); // set current write position file.seekp(read_pos, std::ios::beg); static const char data[] = "aaa"; // write some data file.write(data, 3); } 课程来判断你可能会使用Bootstrap所以基本上你可以这样做

col-md-6
相关问题