I have a little css problem. I have a div container with a given size and absolute position. Inside I have some element and div. an element can be a button or an input in my example. The button complies with the rules and is 100% of the container, the entrance does not comply with the rules and is more than 100% of the container. What is happening and how can I fix it? jsfiddle - click on a widget to see its borders.
CSS
.Object { position: absolute; top: 10px; left: 10px; width: 100px; height: 100px; } .Object .Cover, .Object button, .Object input { position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; overflow: hidden; z-index:0; } .Object button { padding: 2px; } .Object .Cover { cursor: move; z-index:1; }
HTML
<div class="Object" id="3b089a23-7732-e743-aea4-d9dcef359d4e" name="Unnamed Widget" style="height: 30px; "><div class="Cover"></div><input /></div> <div class="Object" id="e1bc0640-e049-eda8-05ac-0a99c21c6fe1" name="Unnamed Widget" style="height: 30px; top: 10px; left: 210px; "><div class="Cover"></div><button data-click="">Unnamed Button</button></div>
Justin808
source share