简体   繁体   English

同一个div的不同设计的浏览器

[英]Browsers with different design for same div

I have a couple of different issues. 我有几个不同的问题。

I have a div with a couple of other divs and some controls in it. 我有一个div与其他几个div和一些控件。 My biggest issue is that it does not look the same in Chrome as it does in other browsers. 我最大的问题是它在Chrome中看起来与在其他浏览器中看起来不一样。 As it is right now, it looks as following: 就像现在一样,它看起来如下: 不同浏览器中的属性框

And the biggest issue is with Chrome, where the textbox to the right of the "width:" text goes down onto the next line. 最大的问题是Chrome,“width:”文本右侧的文本框会显示在下一行。 The code for the box can be seen in this JSFiddle or as as following: 可以在此JSFiddle中看到该框的代码,如下所示:

<div id="div_properties" class="redBorder left" style="clear: left; display: 
    <div class="right">
        <a href="#" id="closePropertiesWindow">
        <img src="close.png" title="Close window"></a>
    </div>
    <div class="centered noMargin whiteBackground">
        <h3 class="noMargin">Properties</h3>
    </div>
    <hr class="noMargin noPadding">

    <div id="div_properties_content" style="display: block;">
        <div class="noMargin propertiesControl" prop="text" style="width:100%;">
            text: 
            <input type="text" id="propertytextTextBox" class="right"></input> 
        </div>
        <div class="noMargin propertiesControl" prop="width" style="width:100%;">
            width: 
            <input type="number" id="propertywidthNumber" class="right"></input> 
        </div>
        <div class="noMargin propertiesControl" prop="italic" style="width:100%;">
            italic: 
            <input type="checkbox" id="propertyitalicCheckBox" class="right" checked="checked"> 
        </div>
        <div class="noMargin propertiesControl" prop="bold" style="width:100%;">
            bold: 
            <input type="checkbox" id="propertyboldCheckBox" class="right"> 
        </div>
        <br>
        <input type="button" id="savePropertiesButton" value="Save" class="right">
    </div>
</div>

And the CSS is as following: CSS如下:

#div_properties {
    margin-top: 5px;
    background-color: #F0F0F0;
    width: 300px;
    float: left;
    min-height: 75px;
}

.redBorder {
    border: 1px solid red;
}

.noMargin {
     margin: 0 0 0 0;
}

.left {
    float: left;
 }

 .right {
      float: right;
 }

(Those are all the related classes in this scope, the other classes defined on the items have no styles, but are being used in the JavaScript.) (这些是此范围内的所有相关类,项目上定义的其他类没有样式,但在JavaScript中使用。)

Also, another issue I'm having is the "box border" around the close-image in IE. 另外,我遇​​到的另一个问题是IE中关闭图像周围的“框边框”。 This is not a big issue, but if anyone knows what is causing it, it would be fantastic. 这不是一个大问题,但如果有人知道是什么导致它,那将是太棒了。

Its the floating that's causing the issue. 它的浮动导致了这个问题。 You need to clear them. 你需要清除它们。

.propertiesControl {
    clear:both;
}

http://jsfiddle.net/JWDkM/2/ http://jsfiddle.net/JWDkM/2/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM