• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

纯css下拉菜单: 纯 css 实现斜角 by co_css

css 搞代码 7年前 (2018-06-11) 160次浏览 已收录 0个评论

css实现斜角的原理主要是利用了div两相互垂直的border的交界 (斜角组合还有更多变化。。。)
<!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"&gt;
<head>
< http-equiv="Content-Type" content="text/html; charset=utf-8" />
< name="robots" content="all" />
< name="author" content="colinivy" />
<link href="http://www.cxybl.com/style/global.css" rel="stylesheet" type="text/css" media="screen" />
<title> Colinivy’s world</title>
<style type="text/css">
* {margin:0; padding:0; list-style:none;}
body {
font-size:63%;
}
#wrapper {
margin:20px;
width:200px;
border: 1px solid #ccc;
font-size:1.2em;
}
#corner {
position:relative;
top:-1px;
left:-1px;
width:0px;
height:0px;
overflow:hidden;
border-top:15px solid #fff;
border-right:15px solid #ccc;
}
#wrapper p {
padding:5px;
text-indent:20px;
}
#joy_left {
width:20px;
height:0px;
overflow:hidden;
border-top:20px solid green;
border-left:20px solid #FFF;
}
#joy_top {
top:-20px;
width:0px;
height:20px;
border-top:20px solid #FFF;
border-right:20px solid red;
}
#joy_bottom {
left:-40px;
top:20px;
width:0px;
height:20px;
border-left:20px solid blue;
border-bottom:20px solid #FFF;
}
#joy_right {
left:-40px;
top:20px ;
width:20px;
height:0px;
overflow:hidden;
border-right:20px solid #FFF;
border-bottom:20px solid #666;
}
.por {
position:relative;
float:left;
}
</style>
</head>
<body>
<div id="wrapper" >
<div id="corner">
</div>
<p>www.cxybl.com</p>
<p>www.cxybl.com</p>
<p>www.cxybl.com</p>
</div>
<div id="joy_left" class="por">
</div>
<div id="joy_top" class="por">
</div>
<div id="joy_bottom" class="por">
</div>
<div id="joy_right" class="por">
</div>
</body>
</html>
本文链接http://www.cxybl.com/html/wyzz/CSS/20130601/38193.html

欢迎大家阅读《纯css下拉菜单: 纯 css 实现斜角 by co…_css》,跪求各位点评,若觉得好的话请收藏本文,by 搞代码


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:纯css下拉菜单: 纯 css 实现斜角 by co_css
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址