css - Video element not quite centered at all widths -


so have video element centered page widths on number, not always. element has been rotated , if width of page falls below length of element, things no longer center correctly. it's hard explain here's jsfiddle:

https://jsfiddle.net/05m04069/

you can shrink down output window width-wise (make skinnier) see how things no longer centered.

posting code here well:

<body class="main-container"> <div class="centered" id="location-header">   seattle </div> <div id="clicktargetcontainer">     <video loop muted  id="mainvideo" src="http://player.vimeo.com/external/123836285.hd.mp4?s=6ddd98cc75f1bb6fb776369a8fa372bf&profile_id=113" type="video/mp4" webkit-playsinline="webkit-playsinline"e ad-outlet="video">         browser not support html5 video.     </video> </div> </body> 

and here's css well:

video {   overflow: hidden;   position: absolute;   height: 56.25%;   margin: auto;   top:0;   bottom:0;   left:0;   right:0;   transform:rotate(90deg);   -webkit-transform:rotate(90deg);  }  .main-container {   min-height: 100%;   position: relative;   background: #000; } 

so looked , think there bug, or maybe inconvenient design decision in html/css. if take landscape video, rotate 90deg (so in portrait), video element still laid out if video not rotated. think there may way change positioning such not problem, when trying that, created many other issues other elements on page. ended doing rotating of video content video editing software , re-encoding it. no longer had use css rotation , widths correct.


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -