如何拉伸输入文本到全宽度?PHP的动态



尝试在我的嵌入式YouTube播放器顶部创建一个动态url栏。

代码如下所示,但正如您所看到的,输入并没有延伸到整个屏幕。

<?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>

目标浏览器是Microsoft Edge,如果有区别的话

width属性已弃用,您需要使用css:

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

如果你把它放在一个单独的样式表中就更好了,这样你就可以很容易地重用你的样式,并且它们会缓存在浏览器中。

最新更新