Note that there are some explanatory texts on larger screens.

plurals
  1. POAnother question on inline-block and how to make IE and Firefox et al work the same
    primarykey
    data
    text
    <p>I've been trying to do something as a learning exercise that I thought should have been fairly simple but can not get it to work on IE 8. I am trying to just draw a web page that looks like a little dialog, with a title element, body, and a footer with an OK and Cancel button. Below is the simple example (no buttons for now) that looks fine in Firefox, I get a nice little square in the upper left of the window. Of course IE draws it as a huge, full width and height square. The key is that I do not want to specify a width, since I plan on using this layout many times with different data, I would like it to expand to fit. I found some comments about setting setting zoom: 1 and then adding *display: inline but I cannot get it to work. Is there an fairly easy solution or do I just need to give up and use tables? Thanks</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="content-type" content="text/html; charset=windows-1250"&gt; &lt;meta name="generator" content="PSPad editor, www.pspad.com"&gt; &lt;title&gt;HI THERE&lt;/title&gt; &lt;style&gt; .dialog { background: red; display: inline-block; zoom: 1; *display: inline; } .dialog-title { background: blue; margin: 10%; } .dialog-item { background: yellow; clear: both; } .dialog-footer { background: green; margin: 10%; } .dialog-ok { display: inline; float: left; background: black; } .dialog-cancel { display: inline; float: right; background: brown; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="dialog"&gt; &lt;form&gt; &lt;div class="dialog-title"&gt;DIALOG TITLE&lt;/div&gt; &lt;div class="dialog-item"&gt;&lt;input type=text name=item1 size=20 value="ITEM1" /&gt;&lt;/div&gt; &lt;div class="dialog-item"&gt;&lt;input type=text name=item2 size=20 value="ITEM2" /&gt;&lt;/div&gt; &lt;div class="dialog-footer"&gt; &lt;div class="dialog-ok"&gt;button1&lt;/div&gt; &lt;div class="dialog-cancel"&gt;button2&lt;/div&gt; &lt;/div&gt; &lt;div style="clear: both;"&gt;&lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload