css-为什么我的文本框没有显示?

css-为什么我的文本框没有显示?,css,html,alignment,Css,Html,Alignment,在“Presse and Medias”部分,我希望在视频旁边(右侧)出现一个白色方框,方框中有“hello”字样。 不幸的是,这不起作用。我看到“你好”这个词,但不是在白色的正方形里。 知道问题是什么以及如何解决吗? 非常感谢, 这是我的html: <div class="section" id="medias"> <div class="center"> <iframe width="350" height="200" class="youtube-p

在“Presse and Medias”部分,我希望在视频旁边(右侧)出现一个白色方框,方框中有“hello”字样。 不幸的是,这不起作用。我看到“你好”这个词,但不是在白色的正方形里。 知道问题是什么以及如何解决吗? 非常感谢,

这是我的html:

<div class="section" id="medias">
<div class="center">
     <iframe width="350" height="200" class="youtube-player" src="http://www.youtube.com/embed/qqXi8WmQ_WM" frameborder="0" allowfullscreen></iframe>
<div id="medias-txt"
        <p>hello</p></div>
 </div>
</div><!--END page4-->

你没有关闭你的div标签

<div class="section" id="medias">
<div class="center">
     <iframe width="350" height="200" class="youtube-player" src="http://www.youtube.com/embed/qqXi8WmQ_WM" frameborder="0" allowfullscreen></iframe>
<div id="medias-txt">
        <p>hello</p></div>
 </div>
</div><!--END page4-->

你好

这应该能奏效


PS喜欢该页面上的视频:)

在css中,您需要在冒号和内容之间添加空格。 例如:


你试过相对定位吗?不错!谢谢;)也就是说,我已经关闭了div标签,但仍然没有看到白色的方块。。。(已上载标签已关闭的新版本)。知道吗?我想我知道了。我在firebug中查看了你的styles.css样式表,在#medias txt之前有两个空格。我在firebug中删除了这些,风格开始流行起来。我不知道为什么这会引起问题。也许是错误的性格。我直接查看了样式表的源代码,但它似乎没有出现在那里。尝试删除#medias txt和youtube播放器样式声明结尾之间的任何间距,看看是否有效。。这让我疯狂。。。我现在已经删除了额外的空格(也改变了视频的大小),现在(1)白色方块仍然不可见,(2)视频周围的白色边框消失了,(3)视频下面现在是“hello”文本。。。Grrrrr…CSS中的空格没有区别。
<div class="section" id="medias">
<div class="center">
     <iframe width="350" height="200" class="youtube-player" src="http://www.youtube.com/embed/qqXi8WmQ_WM" frameborder="0" allowfullscreen></iframe>
<div id="medias-txt">
        <p>hello</p></div>
 </div>
</div><!--END page4-->
#medias-txt
{
background-color: #fff;
color: #000;
width: 100px;
height: 100px;
padding: 10px;
float: right;
}