2013-05-04 48 views
1

我的頁面上有div問題。這是我擁有的唯一一個,它覆蓋了我的頁面中間。在CSS中進行了一些調整後,我完成了一切。DIV元素不包含其所有內容

的問題雖然是視頻(這是div元素中),是偷跑出來,像這樣:

enter image description here

這裏的HTML:

<html> 
<head> 
<link rel="shortcut icon" href="Images/favicon.ico" /> 
<link rel="stylesheet" type="text/css" href="Style.css" media="screen" /> 
    <title>Arthur</title> 
    <meta content="text/html" charset="windows-1251"> 
    </head> 
<Body background="Images/background2.jpg"> 
<A Href="main.html"><IMG class="imgborder" src="Images/button.png" align="left"  height="50"></A> 
<div id="wrapper" style="background-color:black; width:60%; margin-left: auto ; margin-right: auto ;"> 

<center><img width="60%" src="Images/logo2.png"></center> 
<BR><BR> 
<center><img class="imgborder" height="300" src="Images/muller.jpg"></center> 
<Font size="5" color="crimson" face="Calibri"> 

<Center><P align="justify">... </P> 

<P align="justify">...</P> 

<P align="justify">...</P></Font></Center> 



<Center><iframe width="640" height="360" src="..." frameborder="5" 
allowfullscreen></iframe></Center> 
<Font size="5" color="crimson" face="Calibri"><P>Thomas Muller</P></font> 



</div> 
</body> 
</html> 

而這裏的CSS:

@charset"utf-8"; 
/* CSS Document*/ 
/*This section is for links*/ 
a:link { 
    font-weight:normal; 
    color:crimson 
} 
a:visited { 
    font-weight:normal; 
    color:Crimson; 
} 
a:hover { 
    font-weight:bold; 
    color: Royalblue; 
    font-variant:small-caps; 
} 
/*This section is for a paragraph section*/ 
p { 
    font-style:normal; 
    font-size:18px; 
} 
blue { 
    color:crimson; 
} 
/*This section is for the image's black border.*/ 
.imgborder { 
    border-color: crimson; 
    border:thick; 
    border-style:outset; 
} 
.body { 
    background-color: #0000FF; 
} 
html, body { 
    height:100%; 
} 
#wrapper { 
    margin: 0 auto; 
    width: 990px; 
    height:100%; 
    overflow:hidden; 
    position:relative; 
} 
#navigation { 
    margin: 0 auto; 
    width: 990px; 
    height: 55px; 
    background-color: #fff; 
} 
#bottom Half { 
    margin: 0 auto; 
    width: 990px; 
    height: 100%; 
    background-color: #4d3c37; 
} 
div { 
    /* set div to full width and height */ 
    width: 100%; 
    height: 100%; 
} 
p { 
    margin-left:2cm; 
    margin-right:2cm; 
} 
+1

我認爲您的主要問題實際上是您將已棄用的HTML與您發明的標籤混合在一起,並且沒有正確嵌套它們。 – 2013-05-04 17:32:41

+4

這個HTML!最後一次出現在1998年 – Ejaz 2013-05-04 17:54:18

回答

1

我能想到的唯一解決方案是手動LY調整黑框的高度,或者添加

overflow: hidden; 

屬性框(在相當困難的理解的標籤系統,我相信這將是<Center>)。

現在,元素是從其父容器(黑盒)溢出。通過爲此框指定高度,您可以控制大小。

通過指定overflow: hidden,您可以隱藏框的溢出 - 這樣做的兩件事情之一:

  1. 隱藏任何泄漏開箱,防止那些比框的大小,顯示部分大要素那會顯得「綁定」由容器的邊緣

  2. 如果元素與語義HTML,不由height約束和width會自動來調整自身以適應其內容的諸多元素選擇適當

另一種可能的解決方案是爲容器及其子代指定position: relative和/或float: none,這有時可以解決問題。

要再次強調,這是我們很難測試和調試你給我們,因爲它實際上是過時的代碼。

+0

你能詳細說明爲什麼它很難理解(HTML新手,可以使用一些建議)。 – user2350028 2013-05-04 18:17:56

+0

您的HTML並不符合現代標準(請參閱http://www.w3.org/html/和http://www.w3.org/TR/html5/),因此很難處理。 – 2013-05-04 20:22:52

0

將繼承用於視頻的樣式。像顯示樣式屬性可以是'繼承',以及高度和寬度。

+0

我如何使用繼承? – user2350028 2013-05-04 18:19:36

+0

style ='display:inherit;'寬度=「繼承」 – V31 2013-05-04 18:23:32