css+div布局案例
给最外层的div命名一个class
有针对性的进行css布局。
<div class="joinus-info">
<div class="form-title">填写表格</div>
<form action="{sh::U('Index/joinus')}" class="smart-green" onsubmit="return checkform();" method="post" id="myform">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="addTable">
<tr>
<td height="48" align="right"><strong>姓名:</strong></td>
<td colspan="3" class="lt"><input type="text" name="name" id="name" class="" size="45" value=""/></td>
</tr>
<tr>
<td height="48" align="right"><strong>手机:</strong></td>
<td colspan="3" class="lt"><input type="text" name="phone" id="phone" class="" size="45" onkeyup="value=value.replace(/[^\d]/g,'')" value=""/></td>
</tr>
<tr>
<td height="48" align="right"><strong>行业:</strong></td>
<td colspan="3" class="lt">
<select name="business" id="business">
<option value="">-请选择-</option>
<option value="LS">零售</option>
<option value="CY">餐饮</option>
<option value="QT">其他</option>
</select>
</td>
</tr>
<tr>
<td height="48" align="right"><strong>地址:</strong></td>
<td colspan="3" class="lt">
<div id='s_city'>
<select name="province" class="prov set_disabled"></select>
<select name="city" class="city " disabled="disabled"></select>
<select name="district" class="dist " disabled="disabled"></select>
</div>
</td>
</tr>
<tr>
<td height="48" align="right"><strong>详细地址:</strong></td>
<td colspan="3" class="lt">
<input type="text" name="address" id="address" class="address" value=""/>
</td>
</tr> <tr>
<td height="48" align="right"><strong>选择代理商:</strong></td>
<td colspan="3" class="lt" style="width: 80%;">
<volist name="agentData" id="vo" mod="3" key="k" empty="暂时没有数据">
<div style="display:inline-block;width:280px;margin:3px;">
<input type="radio" class="regular-radio" value="{sh:$vo.agent_id}" name="agent_id" id="agent_{sh:$k}" <eq name="k" value="1">checked="checked"</eq>><label for="agent_{sh:$k}"></label><span style="display:inline-block;padding:0px 0px 5px 5px;">{sh:$vo.name} 电话({sh:$vo.tel})</span>
</div>
<eq name="mod" value="2"><br/></eq>
</volist>
</td>
</tr>
<tr>
<td height="48" align="right"><strong>备注:</strong></td>
<td colspan="3" class="lt"><textarea name="remarks" class="" placeholder="请输入备注信息..." style="width:300px;height:80px;"></textarea></td>
</tr>
<tr>
<td></td>
<td class="lt">
<notempty name="agentData"><input type="submit" name="submit" value="提交" class="button btn-success"/></notempty >
</td>
</tr>
</table>
</form>
</div>
这里的joinus-info 就是最外层的class
css布局如下
.joinus-info{margin: 0 auto;width:100%;text-align: left;font-size: 16px;background-color:#EFEFEF;}
.joinus-info table{
margin-left:10%;
}
.joinus-info .form-title{
font-size: 20px;
text-align: center;
padding: 10px;
font-weight: bold;
color:#FB780F;
}
div joinus-info中有一个form smart-green
可以针对form进行布局
.smart-green input[type="text"], .smart-green input[type="email"], .smart-green textarea, .smart-green select {
color: #555;
height: 40px;
line-height:15px;
width: 40%;
padding: 0px 0px 0px 10px;
margin-top: 2px;
border: 1px solid #E5E5E5;
background: #FBFBFB;
outline:;
-webkit-box-shadow: inset 1px 1px 2px rgba(238, 238, 238, 0.2);
box-shadow: inset 1px 1px 2px rgba(238, 238, 238, 0.2);
font: normal 14px/14px Arial, Helvetica, sans-serif;
}
.smart-green input[type="text"].address{width: 60%;} /*这里面存在一个执行顺序的问题class先执行,class下面的input后执行*/
.smart-green textarea{
height:100px;
padding-top: 10px;
}
.smart-green select{
width: 15%;
}
.smart-green input[type="radio"]{
margin-top: 10px;
}
.smart-green .button {
background-color: #9DC45F;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-border-radius: 5px;
border: none;
padding: 10px 25px 10px 25px;
color: #FFF;
text-shadow: 1px 1px 1px #949494;
}
.smart-green .button:hover {
background-color:#80A24A;
}
这样布局,不会对其他的模块造成影响。而且目标明确。有意思。
这样form下的表单元素就会加入smart-green的样式了。
css+div布局案例的更多相关文章
- CSS+DIV布局中absolute和relative区别
原文:http://developer.51cto.com/art/201009/225201.htm 这里向大家简单介绍一下CSS+DIV布局中absolute和relative属性的用法和区别,定 ...
- CSS+DIV布局初练—DIV元素必须成对出现?
一直做C/S开发的工作,但是很少做和布局相关的工作,往往都是同事将界面设计好,自己填写代码而已,对于B/S的工作,做过,但是很少没有像C/S这么多,界面布局的话,更无从谈起. 日子就这么过,一天一个样 ...
- 网站实战 从效果图开始CSS+DIV 布局华为网站
经过我们的前面css的学习,我们已经分模块的掌握的CSS的技术,但是,要是完整的做一个页面,我们还没有接触过,这次呢,小强老师来和大家完整的利用CSS+DIV做一个网站案例,我们来模仿下华为的网站. ...
- CSS:CSS+DIV布局网页
现代网页布局:CSS+DIV: 一般的网页都是顺序布局的,很难达到我们需要的网页布局格式,此时使用DIV进行分层布局,类似于盒子,对每一部分内容进行设计.这是现在主流的网页布局方式,使用DIV+CSS ...
- 关于css+div布局的疑问 2017-03-19
第一次布局一个静态网页,发现许多细节都需要自己探索,出现诸如以下问题: 1.布局问题:经常出现一个div被挤出来?做到一半少一个div布局? 布局之前,要点打好框架,明确每个地方的高宽是多少,争取精确 ...
- 回答: 2017-03-19的关于css+div布局的疑问 2017-04-05
原问题为红色,回答为黑色 第一次布局一个静态网页,发现许多细节都需要自己探索,出现诸如以下问题: 1.布局问题:经常出现一个div被挤出来?做到一半少一个div布局? 布局之前,要点打好框架,明确每个 ...
- CSS+DIV布局应用(2015年06月10日)
Div+css布局应用 一.html元素分类 2.1.顶级元素(Top-level element) 定义 组成html页面最顶级标签 特点 1. 不可设置宽高: 2. 必须在文档流中处于最高级位置: ...
- 十天学会DIV+CSS(DIV布局)
一列布局: 一列固定宽度.一列固定宽度居中.一列自适应宽度.一列自适应宽度居中 一列固定宽度 <head> <style type="text/css"> ...
- css+div 布局遇到的小常识
/根目录../上层目录举例如下: 在photo.css文件中写入: div.ls{ background:url(../photo/framels.jpg) no-repeat left; }div. ...
随机推荐
- DropBox与Box的区别,包括直接的投资人的评价(本地Sync可能还是挺重要的)
作者:曲凯链接:http://www.zhihu.com/question/22207220/answer/20642357来源:知乎著作权归作者所有,转载请联系作者获得授权. Box和Dropbox ...
- Contains Duplicate II 解答
Question Given an array of integers and an integer k, find out whether there are two distinct indice ...
- noip2014总结
noip总结 经过七周的停课,我们终于迎来了期盼已久的noip考试.在这一次的noip考试中,我们经历了很多,也收获了很多.当然这一次考试中也有很多值得总结的地方,特写此总结. 这一次考试考得还不错, ...
- Chart.js | HTML5 Charts for your website.
Chart.js | HTML5 Charts for your website. Chart.js
- Linux系统下定时上传文件至FTP服务器脚本
环境:Red Hat Enterprise Linux Server release 6.4 需求:需要将Oracle数据库的定时备份上传至FTP服务器 1.干货,用户名:oracle,数据库名称:X ...
- telnet 命令使用详解
1..关于NTLM验证由于Telnet功能太强大,而且也是入侵者使用最频繁的登录手段之一,因此微软公司为Telnet添加了身份验证,称为NTLM验证,它要求Telnet终端除了需要有Telnet服务主 ...
- Java学习笔记50:JSONObject与JSONArray的使用
Java不像PHP解析和生产JSON总是一个比较痛苦的过程.但是使用JSONObject和JSONArray会让整个过程相对舒服一些. 需要依赖的包:commons-lang.jar commons- ...
- MVC4 jquery 样式 主题 用法(案例)
MVC4已经自带了jquery,新建的项目,基本上什么都不用添加就可以运行,跑项目.(集成了那么多东西,jquery,modernizr,自带的默认权限,生成的模板,但是缺没有一个统一的文档或者什么去 ...
- module require区别
LUA modue require package 区别 2011-01-19 12:41:35| 分类: 默认分类 | 标签:lua package module require 加载 ...
- 用JSmooth制作java jar文件的可运行exe文件教程【图文】
这是我之前在个人博客3yj上面写的一篇文章,如今转载过来,原文地址 (这不是广告哦) 几年前,刚接触java的是,就想用一些方法把自己的劳动果实保护起来,曾经也用过非常多这种工具,有一个特别好用,今天 ...