CSS 文字两边加直线
2015-12-23 16:41
651 查看
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Examples</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="" rel="stylesheet">
<!-- <script src="http://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script> -->
<title>Float</title>
<style type = "text/css">
span
{
display: block;
position: relative;
border:1px solid green;
width: 1000px;
margin: 10px auto;
height: 1;
}
span p
{
display: block;
position: absolute;
left: 20px;
top: -40px;
/*margin: 0px 20px;*/
padding: 10px;
background-color: #fff;
}
</style>
</head>
<body>
<span>
<p>活动规则</p>
</span>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Examples</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="" rel="stylesheet">
<!-- <script src="http://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script> -->
<title>Float</title>
<style type = "text/css">
span
{
display: block;
position: relative;
border:1px solid green;
width: 1000px;
margin: 10px auto;
height: 1;
}
span p
{
display: block;
position: absolute;
left: 20px;
top: -40px;
/*margin: 0px 20px;*/
padding: 10px;
background-color: #fff;
}
</style>
</head>
<body>
<span>
<p>活动规则</p>
</span>
</body>
</html>
相关文章推荐
- CSS3 学习笔记
- 利用RecyclerView CardView实现新闻卡片样式
- 【html/css】若母div设置了透明度,如何才能使得里面的子div不继承母div的透明度
- css中padding中样式的顺序含义
- 【html/css】模态框的实现
- webkit浏览器自定义滚动条样式代码
- 前端 HTML-CSS 规范
- 2015-12-13复习之CSS3 border 详解border-image
- css设计一个漂亮的表格
- CSS导入使用及引用的两种方法
- CSS权重
- CSS布
- css的opacity属性
- CSS
- CSS padding margin border属性详解
- CSS 特殊样式设置集合
- ECSSHOP表结构
- 利用CSS制作一些实用的图标
- removeAttr删除所有已存在的样式
- CSS中!important的使用