0

I am pretty new to front end. i am exploring it and really loving it.

Here is some problem I encountered. It might be pretty simple.

I have 3 sections on right side of my web page. I want to add a feature to maximise, minimise and close to each of these sections. I am successfull in implementing it using jquery SlideUp() and slideDown() methods.

I am having the buttons like this:

<h2 id = "Heading" style="background-color: grey ;">Movie Names      
<button  id = "minimise" > - </button>
<button id = "maximise" >  + </button>
<button id = "close" > x </button>
</h2>

In my webpage i see a gap between these buttons. I am not sure how to get rid of this space. I want to see something like how windows maximise, minimise and close buttons look.

One more question is how can I add space between Movie Names and these buttons because i want to adjust the positon of these buttons.

Thanks

4

1 回答 1

2

这可能是由于换行引起的空白。 button元素是内联的,因此出现在它们旁边的空格也会出现内联。

看看这是否有所作为:

<h2 id="Heading" style="background-color:grey;">Movie Names
  <button  id="minimise">-</button
  ><button id="maximise">+</button
  ><button id="close">x</button
></h2>

编辑:在这里你可以看到 JSfiddle 的不同之处。 你的代码我的代码。在第二个示例中,按钮元素之间没有空格。但是,由于边距、轮廓等原因,它们可能看起来有空白,您可以通过 CSS 进行控制。

于 2012-07-24T21:02:51.273 回答