Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does my div shift in Opera when toggling hidden div?
    primarykey
    data
    text
    <p>This works fine in all the other browsers but for some reason when I run it in Opera the whole app_cont div seems to shunt a few pixels to the left when I click btn1. I think it has something to do with the icon_div because it doesn't shunt over when I remove it. The icon div is actually svg image but I've changed it to a div because I don't know how to upload th e file onto SO. I'd reall appreciate it if someone could explain to me what I'm doing wrong. </p> <p>Thanks.</p> <pre><code>&lt;!DOCTYPE HTML&gt; &lt;html lang="en-US"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;style type="text/css"&gt; @CHARSET "ISO-8859-1"; html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent} body{line-height:1} article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block} nav ul{list-style:none} blockquote,q{quotes:none} blockquote:before,blockquote:after,q:before,q:after{content:none} a{margin:0;padding:0;font-size:100%;vertical-align:baseline;background:transparent} ins{background-color:#ff9;color:#000;text-decoration:none} mark{background-color:#ff9;color:#000;font-style:italic;font-weight:bold} del{text-decoration:line-through} abbr[title],dfn[title]{border-bottom:1px dotted;cursor:help} table{border-collapse:collapse;border-spacing:0} hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0} input,select{vertical-align:middle} #app_cont { border: 1px solid grey; height: auto; width: 500px; margin: 200px auto; background: #efefef; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; font-family: Arial; padding: 10px } #ab_cont { float: left; height: auto; width: 100%; margin: 10px 0 0px 0; } #answerBox { margin: 0px 10px 15px 0px; padding: 5px 3px; height: auto; width: 225px; padding: 5px 8px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; border: 1px solid grey; font-size: 30px; float: left; } #prog_bar { height: 20px; border: 1px solid grey; margin: 0px 10px 10px 0px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; padding: 3px; background: #dfdfdf; } #prog_inner { height: 20px; -webkit-border-top-right-radius: 2px; -webkit-border-bottom-right-radius: 2px; -moz-border-radius-topright: 2px; -moz-border-radius-bottomright: 2px; border-top-right-radius: 2px; border-bottom-right-radius: 2px; -webkit-border-top-left-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-topleft: 4px; -moz-border-radius-bottomleft: 4px; border-top-left-radius: 4px; border-bottom-left-radius: 4px; background-color: #3299bb; width: 15%; } #btn_cont { border: 1px solid grey; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; background: #dcdcdc; clear: both; padding: 10px; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } #btn1 { margin-left: 20px; margin-right: 30px; } #btn3 { margin-right: 20px; margin-left: 30px; } #sub_btn { font-size: 20px; color: #545454; border: 1px solid #545454; height: 27px; vertical-align: middle; line-height: 27px; height: auto; margin: 0px 0px 15px 0px; float: left; } .app_btns { margin: 0; font-size: 16px; font-family: Arial; font-weight: normal; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; border: 1px solid #ababab; padding: 9px 18px; text-decoration: none; background: -webkit-gradient(linear, left top, left bottom, color-stop(5%, #ededed), color-stop(100%, #dfdfdf) ); background: -moz-linear-gradient(center top, #ededed 5%, #dfdfdf 100%); background: -ms-linear-gradient(top, #ededed 5%, #dfdfdf 100%); filter: progid : DXImageTransform.Microsoft.gradient ( startColorstr = '#ededed', endColorstr = '#dfdfdf' ); background-color: #ededed; color: #777777; display: inline-block; text-decoration: none; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .app_btns:hover { background: -webkit-gradient(linear, left top, left bottom, color-stop(5%, #dfdfdf), color-stop(100%, #ededed) ); background: -moz-linear-gradient(center top, #dfdfdf 5%, #ededed 100%); background: -ms-linear-gradient(top, #dfdfdf 5%, #ededed 100%); filter: progid : DXImageTransform.Microsoft.gradient ( startColorstr = '#dfdfdf', endColorstr = '#ededed' ); background-color: #dfdfdf; cursor: pointer; } .app_btns:active { position: relative; top: 1px; } #hid_div { border: 1px solid grey; background: #f1e8ba; width: 482px; height: auto; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; margin: 0px 0px 10px 0px; float: left; display: none; padding: 8px; line-height: 20px; font-size: 14px; color: #313131; } #icon_div { width: 125px; height: 80px; float: left; margin: 0px 0px -12px 20px; background:darkgrey; } #icon { float: left; height: 65px; width: 65px; margin: -8px 0px 0px 20px; background:black; } #link { text-decoration: none; float: left; /* float: right;*/ /* margin: -10px 0px 10px 0px;*/ margin: -16px 0px 0px 10px; font-size: 12px; color:#ff9900; } &lt;/style&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="app_cont"&gt; &lt;div id="game_pnl"&gt; &lt;div id="prog_bar"&gt; &lt;div id="prog_inner"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div id="ab_cont"&gt; &lt;input type="text" name="answerBox" id="answerBox" autofocus="autofocus" autocomplete="off" maxlength="20" /&gt; &lt;a href="#" id="sub_btn" class="app_btns"&gt;Submit&lt;/a&gt; &lt;div id="icon_div"&gt; &lt;div id="icon"&gt;&lt;/div&gt; &lt;a href="#" id="link"&gt;link link link&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="hid_div"&gt; Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc bibendum tincidunt magna ut fermentum. &lt;/div&gt; &lt;div id="btn_cont" unselectable="on"&gt; &lt;a href="#" id="btn1" class="app_btns" unselectable="on"&gt;Button 1&lt;/a&gt; &lt;a href="#" id="btn2" class="app_btns" unselectable="on"&gt;Button 2&lt;/a&gt; &lt;a href="#" id="btn3" class="app_btns" unselectable="on"&gt;Button 3&lt;/a&gt; &lt;/div&gt; &lt;/div&gt;&lt;!--#game_pnl--&gt; &lt;/div&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" &gt;&lt;/script&gt; &lt;script type="text/javascript" &gt; $(document).ready(function(){ $('#btn1').click(function(){ $('#hid_div').slideToggle(500); }); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Here is the <a href="http://jsfiddle.net/zcwkw/" rel="nofollow">JSfiddle</a> but you can't really see the problem in this because the issue only seems to occur in Opera.</p>
    singulars
    1. This table or related slice is empty.
    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