Donnerstag, 24. April 2014

Höhe und Breite eines HTML Elements mit CSS proportional halten - bei dynamischer Breite/Höhe..

Quelle: http://www.mademyday.de/css-height-equals-width-with-pure-css.html

Mit diesem CSS Trick, bekommt man ein div Element, welches immer die selbe Höhe hat, wie es breit ist.


HTML:
<div class="box">
<div class="content">
Aspect ratio of 1:1</div>
</div>


CSS:
.box{
position: relative;
width: 50%;
}
.box:before{
content: "";
display: block;
padding-top: 100%;
}

In meinem Fall war es nötig einen runden Kreis hinzubekommen bei dynamischer Breite.
(div wird zum kreis mit border-radius:1000px)

Mittwoch, 23. April 2014

HTML Select funktioniert nicht unter Android 2.3. Fix.

Link zum Original-Fix: http://wil.to/android-positioning/

Inhalt, falls der Link irgendwann nicht mehr geht:

"On Android 2.3, a fixed element that contains an absolute positioned element, which itself contains an absolute positioned element, will cause select menus on the page to stop responding altogether.

By removing that nested absolute element (represented by the red square above) the select menu will work normally. Alternately, by removing the fixed positioning of the parent element—either by not disabling user-scalable in one’s viewport tag or by removing the fixed positioning.

Edit: It seems this bug pertains not specifically to nested absolute elements, but to empty absolute elements—including whitespace. By adding a non-breaking space to the nested element, the problem is solved."



Also zum leeren Element einfach ein
<span style='display:none'>&#160;</span>