如何删除两个div或two元素之间的空格 [英] how to remove space between two div or two element
问题描述
Hello Everyone,
祝你周末愉快,任何人都可以帮我解决这个问题,即我需要
删除两个div或两个元素之间的空间(在我的例子中h4和下面的div之间)
i已附加图像和我的CSS我需要保持其他所有东西相同
谢谢
问候
sam
CSS:
Hello Everyone,
wish you a great weekend first, can anyone help me out with this problem i.e i need to
remove space between two div or two elements(between "h4" and below div in my example)
i have attached an image and my css i need to keep every other stuff same
thanks
regards
sam
CSS:
#accrodion
{
width:500px;
height:auto;
border:solid 1px;
padding:10px;
margin:0 auto;
}
#accrodion > h4
{
cursor: pointer;
width:100%;
border: solid 1px;
border-radius: 5px;
}
#accrodion > div
{
width:100%;
height:auto;
border:solid 1px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
这是该代码的html文件,你可以在上面提供css。
Here is the html file of that code and you can reffer the css above.
<body>
<div>
<header>
<h1>accrodion</h1>
</header>
<div id="accrodion">
<h4>Question1</h4>
<div>
<p>You have to create your own html for the accordion. </p>
</div>
<h4>Question2</h4>
<div>
<p>You have to create your own html for the accordion.</p>
</div>
<h4>Question3</h4>
<div>
<p>You have to create your own html for the accordion.</p>
</div>
</div>
<footer>
<p>
© Copyright by Sameer
</p>
</footer>
</div>
</body>
注意:它是一个jquery accrodion ui和m在h4和div之间的空间我不需要但我需要保持其他东西相同,即从顶部填充(第1个h4)和底部和侧面内部accrotion请帮助。
感谢
问题更新将附加信息作为答案发布。[/ Edit]
NOTE: its an jquery accrodion ui and m getting space between "h4" and "div" i dont need but i need to keep other stuff same i.e padding from top (1st h4)and bottom and side inside accrodion please help.
thanks
Question updated with additional information posted as an answer.[/Edit]
推荐答案
float:left。如果你有两个div,并且之间有任何空格,除非你将它们相互浮动,否则你将得到一个空格。
float:left. If you have two divs, and any spaces between, you''ll get one space unless you float them across to each other.
这篇关于如何删除两个div或two元素之间的空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!