2015-07-13 58 views
0

试图使我的嵌入式YouTube Player上的动态url栏。如何将输入文本拉伸为全宽?动态PHP

代码如下所示,但正如您所看到的,输入不会跨越整个屏幕。

<?php 
    $uri='https://www.playstation.com/etc/designs/pdc/clientlibs_youtube/swf/ps-youtube-player.swf?v=' .$_GET['v'] . '&embedding=0&autoplay=0&sharing=0&fullscreen=1'; 
    $old='https://youtube.com/embed/' . $_GET['v'] . '?autoplay=1&fs=1&modestbranding=1&rel=0&theme=light&origin=https://www.tsiserver.us/WinTube'; 
    $keep='https://youtube.com/watch?v='. $_GET['v']; 
?> 
<body style="background-color: black; margin: 0px;"> 
<div style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; padding: 0px; margin: 0px; height: 20px; width: 100%;"> 
    <input type="text" width="100%" value="<?php echo $keep; ?>" /> 
</div> 

<div style="position: absolute; top: 20; left: 0; right: 0; bottom: 0; padding: 0px; margin: 0px;"> 
    <iframe src="<?php echo $old; ?>" width="100%" height="100%" frameBorder="0" /> 
</div> 

目标浏览器是微软的边缘,如果这有什么差别。

+0

您是否试过'style =“width:100%;”'而不是'width'属性? – Matt

+0

好吧,现在它的工作...它不是与它只适用于'/>' – GTAWWEKID

回答

0

width属性已被弃用,你需要使用CSS:

<input type="text" style="width: 100%;" value="<?php echo $keep; ?>"> 

它甚至会更好,如果你把它放在一个单独的样式表,这样就可以轻松地重用你的风格,它们被缓存在浏览器中。