html - How can you center a swf object? -
my swf responsive it's hard center, i'm hoping find , easy way that. can object act img tag , centered in css? tested theory no luck. how make code center? have alternative can responsive , centered?
it looks this:
what below not helping. x
try of these alternatives
css positioning
.hdiv {
position: absolute; left: 0; top: 0; bottom: 0; right: 0; } object { position: absolute; left: 25%; top: 25%; width:50%; height: 50%; background:#000; }
flexbox approach
.hdiv {
note need prefix flexbox classes browsers , syntax might different , vh not supported older browsers.
display:flex; justify-content:center; align-items:center; height:100vh; } object {
background:#000; width:50%; height:50%; }
with css transform
.hdiv {
position: absolute; top: 50%; left: 50%;
background: #000; transform: translate(-50%,-50%);
}
Comments
Post a Comment