css模仿表格 居中

<div class="service_box">
<div class="service_list"> <span class="service_img"><img src="http://www.cnblogs.com/images/ReserveServices/YuYue1.png" /></span> <span class="service_desc"><em>吸油烟机</em><br /><em>JQ01T</em></span>
<span class="install_btn">安装</span>
<span class="repair_btn">保修</span>
</div>

</div>
<style><!--
.service_list {height:130px;font-size:0;border-bottom:1px solid #333333;line-height:130px;}
.service_list span{display:inline-block;background:#ccc;vertical-align:middle;font-size:24px;color:#d8a386;position:relative;margin-right:20px;}

.service_list span.service_img{width:120px;text-align:center;}
.service_list span.service_desc{line-height:1.2;width:158px;text-align:center;}
.service_list span.install_btn{height:55px;line-height:55px;width:120px;text-indent:52px;border-radius:10px;border:1px solid #b68250;background:rgba(216,163,134,0.3);margin-left:0px;}
.service_list span.repair_btn{height:55px;line-height:55px;width:120px;text-indent:52px;border-radius:10px;border:1px solid #b68250;background:rgba(216,163,134,0.3);margin-right:0px;}
--></style>

时间: 2024-08-15 09:26:50

css模仿表格 居中的相关文章

CSS 构造表格

表格边框 CSS 中设置表格边框,请使用 border 属性: <style type="text/css"> table{ border:1px solid red; } th,td{ border:1px solid red; } </style> </head> <body> <table> <tr> <th>姓名</th> <th>描述</th> </t

四个好看的CSS样式表格

文章来源 http://www.cnphp6.com/archives/58020 1. 单像素边框CSS表格 这是一个非经常常使用的表格样式. 源码: 2. 带背景图的CSS样式表格 和上面差点儿相同,只是每一个格子里多了背景图. cell-blue.jpg cell-grey.jpg 1. 下载上面两张图,命名为cell-blue.jpg和cell-grey.jpg 2. 拷贝以下的代码到你想要的地方,记得改动图片url 3. 自己主动换整行颜色的CSS样式表格(须要用到JS) 这个CSS样

HTML和CSS中的居中效果(1)

HTML和CSS中的居中效果 单行上下左右居中 Html: <div class="container"></div> CSS: .container{ width: 600px; height: 300px; text-align: center; line-height: 300px; border: 1px solid green; } 固定高宽上下左右居中 Html: <div class="container"><

css实现永远居中的背景图片

<title>css实现永远居中的背景图片丨</title> <STYLE TYPE="text/css"> <!-- BODY {background-image: URL(/images/m02.jpg); background-position: center; background-repeat: no-repeat; background-attachment: fixed;} --> </STYLE> <br

css中各种居中的奇技淫巧总结

css中各种居中的奇技淫巧总结   第一种,在固定布局中比较常用的技巧设置container的margin:0 auto:   第二种(从布局中入手)   css .outer{ height:200px; width:200px; background:gray; position:relative; } .inner{ width:100px; height:100px; top:50%; left:50%; background:black; position:absolute; marg

【转】如何只用CSS做到完全居中

英文原版链接:http://codepen.io/shshaw/full/gEiDt 我们都知道 margin:0 auto; 的样式能让元素水平居中,而 margin: auto; 却不能做到垂直居中……直到现在.但是,请注意!想让元素绝对居中,只需要声明元素高度,并且附加以下样式,就可以做到: 1 2 3 4 5 .Absolute-Center {   margin: auto;   position: absolute;   top: 0; left: 0; bottom: 0; rig

常用的四种CSS样式表格

1. 单像素边框CSS表格 这是一个很常用的表格样式. [html] <style type="text/css"> table.gridtable { font-family: verdana,arial,sans-serif; font-size:11px; color:#333333; border-width: 1px; border-color: #666666; border-collapse: collapse; } table.gridtable th {

用div css模拟表格对角线

<!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> <title>用div css模拟表格对角线</t

CSS控制表格嵌套

1. [图片] table.jpg ?2. [代码]用CSS处理表格嵌套完整代码 <style type="text/css">.form-table{    border-collapse:collapse;    border-spacing:0px;    border-style:solid solid solid solid;    border-width:1px;    border-color:#000000;}.form-table table{    b