如何摆脱Div标签之间的差距 [英] How to get rid of the gap between Div tags

查看:54
本文介绍了如何摆脱Div标签之间的差距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!


我正在创建一个控件,让用户可以使用两个文本框和两个按钮输入时间值。当用户点击按钮时,小时或分钟的文本框值会发生变化....这只是JavaScript的东西而且工作正常。


我的问题是我想要一个开始时间和结束时间在我的控制中,我遇到了一些操纵控件外观的问题。


我想要的是将两个文本框放在一起(小时的文本框后跟分钟的文本框)和文本框旁边(左侧)的按钮......按钮位于另一个的顶部...

我有它,所以文本框在他们自己的< div>和他们自己的按钮< div>。使用CSS将按钮移动到文本框旁边。我无法使用浮动,因为我遇到过Firefox的问题。


现在它看起来还不错,除了开始时间和结束时间之间的巨大差距。


我认为这个差距正在发生,因为我正在移动文本框旁边的按钮使用位置:relative和left,top,& bottom。


有人可以帮我摆脱这个差距。


到目前为止我已经包含了我的代码......非常简单。我为asp标签道歉,我希望他们不要混淆你。


非常感谢您的时间!


Hi there!

I''m creating a control that lets user''s enter a time value using two text boxes and two buttons. When the user clicks the button, the text box value for the hours or minutes change....that''s just JavaScript stuff and it works fine.

My problem is that I want to have a "Start" time and an "End" time in my control and I''ve run into a few problems manipulating the look of the controls.

What I''d like is to have the two text boxes beside each other (the text box for the hour followed by the text box for the minutes) and the buttons beside (to the left) of the text boxes...where the buttons are on top of one another...

I have it so that the text boxes are in their own <div> and the buttons in their own <div>. The buttons have been moved using CSS to be beside the text boxes. I couldn''t use float because of issues I''ve been experiencing with Firefox.

Right now it looks okay except for the Huge gap between the Start time and the End time.

I think this gap is occurring because I''m moving the buttons beside the text boxes using position:relative and left,top,&bottom.

Could someone please help me get rid of this gap.

I''ve included my code so far...its pretty simple. I apologize for the asp tags, and I hope they don''t confuse you.

Thanks a lot for your time!


展开 | 选择 | Wrap | 行号

推荐答案

你可以用任何方式向我们提供html吗?很难破译。


编辑:没关系。我想通了。


你对浮子有什么问题?它通常是IE有漂浮问题。
Any way you can give us html out of that? It is hard to decipher.

Never mind. I figured it out.

What problems are you having with the floats? It''s usually IE that has float problems.


我很难与之合作,因为我不想消除一些东西,因为我不是知道还有什么计划。看起来你有一点''div-itis'',需要将所有内容包装在div中,并且有很多不必要的CSS。我不得不停止我正在做的事情去某个地方但是这样做你想要的。它可以进一步简化。
It''s hard for me to work with this because I didn''t want to eliminate some things because I don''t know what else is planned. It looks like you have a touch of ''div-itis'', the need to wrap everything in a div, and there is a lot of unnecessary css. I had to stop what I was doing to go somewhere but this sort of does what you want. It can be simplified further.
展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号



这很难对我来说,因为我不想消除一些东西,因为我不知道还有什么计划。看起来你有一点''div-itis'',需要将所有内容包装在div中,并且有很多不必要的CSS。我不得不停止我正在做的事情去某个地方但是这样做你想要的。它可以进一步简化。
It''s hard for me to work with this because I didn''t want to eliminate some things because I don''t know what else is planned. It looks like you have a touch of ''div-itis'', the need to wrap everything in a div, and there is a lot of unnecessary css. I had to stop what I was doing to go somewhere but this sort of does what you want. It can be simplified further.



感谢您帮助Drhowarddrfine!


我绝对有点div-itis。我对CSS很陌生,尤其是< div>标签。


我发现让这些东西以我认为应该的方式工作真的很有挑战性。

我在FireFox上遇到的问题是浮动标签浮动到其包含< div>的一侧(和顶部)。


我已经做了你推荐的更改(删除了那些不必要的< div>)但是当我在FireFox中运行它们时它们仍然悬浮在包含盒子。


你对如何解决这个问题有什么建议吗?

(我想这是原来的问题,因为当我发生间隙的事情发生时试图解决它)


-Frinny

Thanks for helping Drhowarddrfine!

I definitely have a touch of "div-itis". I''m quite new to CSS and especially quite new to <div> tags.

I''m finding it really challenging to get this stuff to work the way I think it should.
The problem I''m having with FireFox is that the floating tags are floating out side (and on top) of their containing <div>.

I''ve made the changes that you''ve recommended (removed those unnecessary <div>) but when I run it in FireFox they are still floating out side of the containing box.

Do you have any recommendations on how to fix this problem?
(I guess it was the original problem because that gapping thing was happening while I was trying to work around it)

-Frinny


这篇关于如何摆脱Div标签之间的差距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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