Note that there are some explanatory texts on larger screens.

plurals
  1. POIE7 display-block and width: auto
    primarykey
    data
    text
    <p>I've got a little problem and it's been bugging me for a little while, as much as i've tried, i couldn't or the life of me find a solution on here or through google that solved it. The problem itself only persists in IE7 ( i am unsure about IE6 but i would like to say that the result is somewhat similar to IE7)</p> <p>Here is my mark up:</p> <pre><code>&lt;div class="roomsLeft"&gt; &lt;a href="#" class="selectProperty button"&gt;Select&lt;/a&gt; &lt;span&gt;Only 3 rooms left!&lt;/span&gt; &lt;/div&gt; </code></pre> <p>and here is the CSS for said mark up:</p> <pre><code>.roomsLeft{ background:#fffed7; border-radius:5px; padding:1px; margin:15px 0 0 0; border:1px solid #ffd542; margin-right:-3px; width:auto; display:inline-block;} .roomsLeft span{ color:#555; font-size:0.7em; padding: 9px 8px 8px 8px; display:inline-block; width:auto;} </code></pre> <p>CSS for the button if it's needed:</p> <pre><code>.button { font-family:tahoma; background:#F70065; background:-moz-linear-gradient(top,#fb458f 0%,#F70065 100%); background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#fb458f),color-stop(100%,#F70065)); background:-webkit-linear-gradient(top,#fb458f 0%,#F70065 100%); background:-o-linear-gradient(top,#fb458f 0%,#F70065 100%); background:-ms-linear-gradient(top,#fb458f 0%,#F70065 100%); background:linear-gradient(top,#fb458f 0%,#F70065 100%); /* For Internet Explorer 5.5 - 7 */ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fb458f, endColorstr=#F70065 ); /* For Internet Explorer 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#fb458f, endColorstr=#F70065 )"; padding:7px 9px; color:#fff; font-size:0.7em; border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; border:1px solid #DD005B; font-weight:800; text-decoration:none; letter-spacing:0em; text-shadow:1px 0px 5px #DD005B; box-shadow:inset 0px 1px rgba(255,255,255,0.2);} .button:hover { background:#F70065; background:-moz-linear-gradient(top,#fb458f 0%,#F70065 100%); background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#fb458f),color-stop(100%,#F70065)); background:-webkit-linear-gradient(top,#fb458f 0%,#F70065 100%); background:-o-linear-gradient(top,#fb458f 0%,#F70065 100%); background:-ms-linear-gradient(top,#fb458f 0%,#F70065 100%); background:linear-gradient(top,#fb458f 0%,#F70065 100%); /* For Internet Explorer 5.5 - 7 */ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fb458f, endColorstr=#F70065 ); /* For Internet Explorer 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#fb458f, endColorstr=#F70065 )"; padding:7px 9px; color:#fff; font-size:0.7em; border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; border:1px solid #DD005B; font-weight:800; text-decoration:none; letter-spacing:0em; text-shadow: 0 0 5px rgba(255,255,255,0.7); box-shadow:inset 0px 1px rgba(255,255,255,0.2), 0 0 5px rgba(247, 0, 101, 0.5);} </code></pre> <p>Here's a fiddle of what it looks like in all the other major browsers (IE8-10, Chrome, FF &amp; Opera):</p> <p><a href="http://jsfiddle.net/vpF27/" rel="nofollow">http://jsfiddle.net/vpF27/</a></p> <p>the parents width only stretches to the combined width of it's children no matter the width of the parent container, however ... In strolls IE7 and his older brothers to wreck up the place and decides that</p> <pre><code>.roomsLeft </code></pre> <p>needs to fill the entire parent, any parent.</p> <p>Now i've tried taking the culprit out of the context of my project (and away from any other items that might be interfering) and ran the css and html in a seperate file, hoping to narrow down any problems, but unfortunately this didn't solve anything, the problem still persists.</p> <p>any help you guys can provide would be fantastic.</p> <p>thank you.</p> <p>EDIT: hopefully this <a href="http://jsfiddle.net/uWT3d/" rel="nofollow">fiddle</a> gives a little bit more context of what's going on inside IE7. in all other browsers, adding</p> <pre><code>display:block; </code></pre> <p>to </p> <pre><code>.roomsLeft </code></pre> <p>solves the problem</p>
    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