{"id":9810,"date":"2013-04-26T06:59:48","date_gmt":"2013-04-26T06:59:48","guid":{"rendered":"http:\/\/musilda.cz\/?p=218"},"modified":"2013-04-26T06:59:48","modified_gmt":"2013-04-26T06:59:48","slug":"jak-na-responsivni-youtube-video-ve-wordpress","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/jak-na-responsivni-youtube-video-ve-wordpress\/","title":{"rendered":"Jak na responsivn\u00ed Youtube video ve WordPress"},"content":{"rendered":"
S prvky, kter\u00e9 vkl\u00e1d\u00e1me do sv\u00fdch web\u016f, m\u016f\u017ee b\u00fdt \u010dasto probl\u00e9m, p\u0159edev\u0161\u00edm, pokud m\u00e1me responsivn\u00ed design a prvek m\u00e1 nastavenou \u0161\u00ed\u0159ku v pixelech. Typick\u00fdm p\u0159\u00edkladem jsou videa z youtube, kter\u00e1 pak nep\u0159\u00edjemn\u011b kaz\u00ed vzhled str\u00e1nky, p\u0159et\u00e9kaj\u00ed z obsahu do sidebaru a zakr\u00fdvaj\u00ed jin\u00e9 prvky st\u00e1nky. Dal\u0161\u00ed je box pro facebook, kter\u00fd n\u011bkdy rozb\u00edj\u00ed design,ale v tomto \u010dl\u00e1nku se budeme zab\u00fdvat jen videem.<\/p>\n
Typick\u00fd youtube k\u00f3d, se kter\u00fdm se m\u016f\u017eeme setkat, je:<\/p>\n
<\/pre>\nIframe m\u00e1 nastavenou pevnou \u0161\u00ed\u0159ku a na men\u0161\u00edch \u0161\u00ed\u0159k\u00e1ch obrazovky to m\u016f\u017ee b\u00fdt probl\u00e9m. \u0158e\u0161en\u00ed je jednoduch\u00e9 a v n\u00e1vodech na n\u011bj m\u016f\u017eete \u010dasto narazit, sta\u010d\u00ed obalit vkl\u00e1dan\u00fd k\u00f3d divem a upravit css:<\/p>\n
\n\n<\/div><\/pre>\n.video-container {\n\tposition: relative;\n\tpadding-bottom: 56.25%;\n\tpadding-top: 30px;\n\theight: 0;\n\toverflow: hidden;\n}\n\n.video-container iframe,\n.video-container object,\n.video-container embed {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n}<\/pre>\n