CSS实现三角形

本文介绍如何使用CSS实现一个带有三角形装饰的标题样式,该样式不依赖于图片资源,全部采用CSS代码完成,包括背景设置及特殊形状的创建。
ExpandedBlockStart.gif代码
<!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" />
<link rel="stylesheet" href="http://www.n1pay.com/templets/zhifu/style/reset.css" type="text/css" />
<title>无标题文档</title>
<style>
body
{
    background
:url(http://bbs.blueidea.com/attachment.php?aid=157417&k=6d63e29bcfc152ef20fee8078c57a828&t=1293673644&noupdate=yes);
}
#wrap 
{
    width
:920px;
    margin
:0 auto;
    padding
:20px;
}
.box
{
    background
:#FFFFFF;
    padding-top
:20px;
}
.box h2
{
    position
:relative;
    right
:-16px;
    height
:48px;
    background
:#DD4C2D;
}
.sanjiao
{
    background
:#fff;
    height
:16px;
    position
:relative;
}
.bor
{
    border-top
:8px solid #A23919;
    border-left
:8px solid #A23919;
    border-right
:8px dashed transparent;
    border-bottom
:8px dashed transparent;
    width
:0px;
    height
:0px;
    font-size
:0px;
    overflow
:hidden;
    position
:absolute;
    right
:-16px;
    top
:-2px;
}
</style>
</head>
<body>
    
<div id="wrap">
        
<div class="box">
            
<h2></h2>
            
<div class="sanjiao"><div class="bor"></div></div>
            
<div style="padding:0px 20px;">其他的文字,其他的文字。其他的文字,其他的文字。其他的文字,其他的文字。其他的文字,其他的文字。其他的文字,其他的文字。其他的文字,其他的文字。其他的文字,其他的文字。其他的文字,其他的文字。其他的文字,其他的文字。其他的文字,其他的文字。其他的文字,其他的文字。其他的文字,其他的文字。</div>
        
</div>
    
</div>
</body>
</html>
不用图片实现的效果

 

转载于:https://www.cnblogs.com/strawer/archive/2010/12/30/1922265.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值