内联div之间添加空格. [英] Adding space between inline divs.

查看:166
本文介绍了内联div之间添加空格.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我通过添加"float:left;"来内联一些Div标签.在CSS中.现在,我想在它们之间添加一些空间.这样做的代码是什么?

注意:在3个div中,我需要一些间距,它们嵌套在另一个容器div中.

Hi,

I''ve made some Div tags inline by adding "float:left;" in CSS. Now, I want to add some space between them. What is the code to do so?

Note: There are 3 divs in which I want some spacing, and they''re nested in another container div.

推荐答案

您可以在CSS上添加
you can add on css
#div_1 
{
margin-right:10px;
}


您可以更改所需的像素数.


you can change the number of pixels you wish.


基于CSS box模型的知识,可以轻松解决所有这些问题和类似问题.请参阅:
http://www.w3schools.com/css/css_boxmodel.asp [ http://www.w3.org/TR/CSS2/box.html [ ^ ].

-SA
All those and similar problems are easy solved based on the knowledge of the CSS box model. Please see:
http://www.w3schools.com/css/css_boxmodel.asp[^].

I hope that just one glance at the picture shown in the page referenced above to get the idea.

Where to get the complete description of this part of CSS? In the standard, of course:
http://www.w3.org/TR/CSS2/box.html[^].

—SA


<div style="margin-left: 13px;"></div>


该div是右侧div

可能对您有帮助


This div is right side div

It may be help you


这篇关于内联div之间添加空格.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆