幫助項目... eeekHTML固定表例子和CSS〔實施例
(b) Allow both bars extend the full length of the browser window.
(c) Specify the header bar and footer bar with different, light background colors.
(d) Center links and bottons in respective bars.
(e) Use three light colors to specify the background of the paragraph elements so that the three colors alternate.
(f) Leave a gap between page content and the window's left and right border.
我的HTML:
<!DOCTYPE html>
<html>
<head>
<title>
My test
</title>
<meta charset="UTF-8">
</head>
<style>
<body>
</style>
<div id="headbar1" >
<a href="https://www.example.com">BBC news</a>
<a href="https://www.example.com">The Guardian</a>
</div>
<?php
for ($n=1; $n<=101; $n++)
echo "Paragraph" ;
?>
<div align="center" id="footbar"style="background-color: #ffff66";>
<form>
<input type="button" onclick="location.href='https://www.example.com';" value="Facebook" />
<input type="button" onclick="location.href='https://www.example.com';" value="Instagram" />
</div>
</form>
</body>
</html>
我的CSS:
.headbar1 {
background-color: #ffccff;
position:fixed;
top:0;
width:100%;
z-index:100;
align:center;
}
我在做什麼錯? 感謝
對不起形象的描述是它應該是什麼樣子 - 伊克 – swlon
你考不上的jsfiddle有PHP代碼的HTML塊-_- – Cuchu
在'fiddle'的HTML是無效的 - 你有一個div stradding形式,一個類似的東西與開放的'body'標籤跨越一個樣式標籤。 – RamRaider