Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 浮动过右_Jquery_Css_Internet Explorer 7_Internet Explorer 6_Css Float - Fatal编程技术网

Jquery 浮动过右

Jquery 浮动过右,jquery,css,internet-explorer-7,internet-explorer-6,css-float,Jquery,Css,Internet Explorer 7,Internet Explorer 6,Css Float,我有一个记录管理web应用程序,它在一个屏幕上显示主记录,并在编辑器div中动态构建编辑器,我使用JQuery使其可拖动。这很有效 尽管div不是一个窗口,但我认为让它更像一个窗口可能是一个好主意,所以我在一个关闭按钮中进行了编码。结构如下所示: <div id="editor"> <div id="draghandle" /> <div id="closebutton" /> <div id="editorbody" /> </

我有一个记录管理web应用程序,它在一个屏幕上显示主记录,并在编辑器div中动态构建编辑器,我使用JQuery使其可拖动。这很有效

尽管div不是一个窗口,但我认为让它更像一个窗口可能是一个好主意,所以我在一个关闭按钮中进行了编码。结构如下所示:

<div id="editor">
  <div id="draghandle" />
  <div id="closebutton" />
  <div id="editorbody" />
</div>
Editorbody是可变维度,具体取决于用户试图输入的内容

Draghandle的宽度设置为编辑器的100%。Closebutton在CSS中设置为float:right

我的问题是,在IE6和IE7中,关闭按钮浮动得太右。无论我将编辑器div拖到哪里,它都始终紧靠窗口的右边缘。在Firefox和Safari中,它看起来像我预期的那样-窗口与editorbody一样宽,而closebutton位于右上角

我并不特别喜欢float:是的,我只是想找到一种方法来设置CSS,在所有浏览器中都能得到相同的结果。有什么想法吗

截图 这是我想在jsbin上做的一个模型谢谢,redsquare

我正在处理法律敏感信息,因此无法提供应用程序的屏幕截图。然而,我拍摄了一些照片,并屏蔽了文本和界面,只留下了窗口结构


有时需要CSS黑客:

* + html #editor #closebutton /* IE7 */, * html #editor #closebutton /* IE6 */ {margin-right: 100px;} // insert whatever value that fits here

有时需要CSS黑客:

* + html #editor #closebutton /* IE7 */, * html #editor #closebutton /* IE6 */ {margin-right: 100px;} // insert whatever value that fits here

对于特定于IE的css攻击,您可以执行以下操作:

#divId {    
   margin-right: 0; /*Normal styles for all browsers*/    
  *margin-right: 100px; /*The asterisk allows only for IE6 AND IE7 to read this*/        
  _margin-right: 90px; /*The underscore allows only IE6 to read this style*/    
}

只需确保星号和下划线标记放在正常有效的css样式之后。

对于IE特定的css标记,您可以执行以下操作:

#divId {    
   margin-right: 0; /*Normal styles for all browsers*/    
  *margin-right: 100px; /*The asterisk allows only for IE6 AND IE7 to read this*/        
  _margin-right: 90px; /*The underscore allows only IE6 to read this style*/    
}

只是确保星号和下划线的HAKS被放置在正常有效的CSS样式之后。

< P>你可以考虑只使用A,因为它是预先创建的,样式已经在跨平台工作了。

< P>你可以考虑只使用A代替它,因为它的预处理和样式已经在跨平台工作。解决这个问题的办法是将closebutton的CSS从

float: right;


这将在IE中产生正确的结果,并且内部表单字段有一点填充,就不必担心重叠。

对于记录,解决这一问题的方法是将closebutton的CSS从

float: right;


这将在IE中产生适当的结果,并且内部表单字段有一点填充,就不必担心重叠。

但是编辑器可以拖动到页面上任何人们想放置它的地方。他们可以把它靠在窗户的右边。即使我将关闭按钮重新定位到编辑器的放置代码中-嗯。我有一个想法,现在可能可以工作了。不。渲染后将编辑器div的宽度设置为editorbody的宽度仍然会使其太宽。我以为我在那个里找到了一些东西。但编辑可以拖到人们想放在页面上的任何地方。他们可以把它靠在窗户的右边。即使我将关闭按钮重新定位到编辑器的放置代码中-嗯。我有一个想法,现在可能可以工作了。不。渲染后将编辑器div的宽度设置为editorbody的宽度仍然会使其太宽。你能在jsbin.com或pastebin.mecan你能在jsbin.com或pastebin.mehanks上做些什么吗!伙计,接下来我要做的就是做一个灯箱模型!谢谢伙计,接下来我要做的就是做一个灯箱模型!这真的很有帮助,因为改变‘右’的‘px’做了工作。这真的很有帮助,因为改变‘右’的‘px’做了工作