我試圖在我的網站的一部分中使用白色圓形矩形作爲背景。我試圖用CSS,但我無法得到圓形矩形伸展或縮小到div的大小。試圖在圖像上顯示文字
我的另一個嘗試是在下面使用img元素。現在我可以根據div中的文本的多少來動態拉伸圖像,現在我無法在其上放置任何文本。
你知道我如何讓文本出現在第2欄的背景中嗎?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
<!--
body { background-color: red; }
.col1 { width: 20%; float: left; background-color: blue; }
.col2 { width: 60%; float: left; }
.col3 { width: 20%; float: left; background-color: yellow; }
#content { z-index: 10; }
#bk { z-index: 0; top: 0px; left: 0px; }
-->
</style>
</head>
<body>
<div class="col1">
abvdvf
</div>
<div class="col2">
<div id="content">
kjfdjkf
</div>
<img id="bk" src="i.png" width="100%" height="100%" /> <!-- Correctly resizes my picture but now I cant place any text over the pic -->
</div>
<div class="col3">
abvdvf
</div>
</body>
</html>
+1,因爲HTML Purifier非常棒。哦,你的回答是有道理的。 – thirtydot 2011-03-07 03:06:22