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: enter image description here

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 {
display:flex; justify-content:center; align-items:center; height:100vh; } object {
background:#000; width:50%; height:50%; }
note need prefix flexbox classes browsers , syntax might different , vh not supported older browsers.

with css transform

.hdiv {
position: absolute; top: 50%; left: 50%;
background: #000; transform: translate(-50%,-50%);
}


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -