這是使用 CSS + DIV 標籤製作的裝飾外框 | ||
以下是 CSS 完整的語法標籤 | ||
<html> <head> <title>Simple Gallery</title> <style type="text/css"> .photo { margin: 30px; position: relative; /* 指定 div 元素的位置是相對值 */ width: 180px; height: 130px; float: left; } .photo img { background: #fff; border: solid 1px #ccc; padding: 4px; } .photo a { text-decoration: none; } .sample5 span { width: 216px; height: 166px; display: block; position: absolute; /* 指定 span 元素的位置是絕對值 */ top: -17px; left: -18px; background: url(images/gold-frame.png) no-repeat; } </style> </head> <body> <div class="photo sample5"> <a href="#"><span></span><img src="images/11.jpg" alt="image" width="170" height="120"></a> </div> </body> </html> | ||
為了證明這套做法是多麼的靈活多便,作者特別製作 15 種不同風格的範例給你實際瞭解 Go 。 |
|