In web applications, one of the markups/decorations is rounded corners.
There are a lot of ways to do this, e.g., http://www.devwebpro.com/25-rounded-corners-techniques-with-css/.
Recently, I have the requirement to do this with minimal pictures envolved because pictures are considered not safe and using too much bandwidth, and thus are filtered out by some security firewalls.
One interesting post is here: http://blog.benogle.com/2009/04/29/css-round-corners/. Though the result has a little rough edge, it's better than plain text.
I need to extend this trick to a tabbed menu bar. All current practices I found are using pictures. So I come up with the following code.
<html>
<head>
<style type="text/css">
.mb1h, .mb2h, .mb3h, .mb4h {font-size:1px; overflow:hidden; display:block;}
.mb1h {height:1px; margin:0 5px;}
.mb2h {height:1px; border-right:0px; border-left:0px; margin:0 3px;}
.mb3h {height:1px; border-right:0px; border-left:0px; margin:0 2px;}
.mb4h {height:2px; border-right:0px; border-left:0px; margin:0 1px;}
.mheadh {border-right:0px; border-left:0px;}
.mheadh h3 {margin: 0px 0px 0px 0px; padding-bottom: 0px;}
.menutab a {text-decoration: none; background-color: #DBFF6C; color: black; border-bottom: 1px solid #DBFF6C;}
.menutab a:hover {background-color: #ff0000; border-bottom: 1px solid #ff0000;}
.menutab a:visited {color: black; }
</style>
</head>
<body>
<table cellspacing="0" cellpadding="1">
<tr>
<td class="menutab">
<a href="#">
<b class="mb1h"></b><b class="mb2h"></b><b class="mb3h"></b><b class="mb4h"></b>
<div class="mheadh"><h3> Home </h3></div>
</a>
</td>
<td class="menutab">
<a href="#">
<b class="mb1h"></b><b class="mb2h"></b><b class="mb3h"></b><b class="mb4h"></b>
<div class="mheadh"><h3> Register </h3></div>
</a>
</td>
</tr>
</table>
<div style="position:relative;top:0;left:0;background-color:#33ff33;height:20px;width:95%;padding-top:0px;padding:0;">
</div>
</body>
</html>
The extension I did here is to make sure the "hover" function behaviors correctly.
Of course, using pictures provides a much better user experience.
本文介绍了一种使用CSS实现圆角效果的方法,并通过最小化图片使用来提高安全性及减少带宽消耗。此外,还提供了一个不依赖图片的Tab菜单栏实现案例。
1192

被折叠的 条评论
为什么被折叠?



