css梅花
『壹』 用CSS格式化网页有哪3种方式
外链样式
<link href="cc.css" type="text/css" rel="stylesheet" />
行内样式
<div style="border:solid 1px red;"></div>
内链样式
<style type="text/css">
border:solid 1px red;
</style>
C是错误的,样式只能用于head 和行内还有文件调用
『贰』 求CSS中<img>的美化
.img-no-padding{
padding:0px;
}
.img-circle{
background-color:#FFFFFF;
margin-bottom:10px;
padding:4px;
border-radius:50%!important;
max-width:100%;
}
『叁』 使用CSS来格式化网页有哪种方式
一般最常用的方式就是写一个reset.css文件,在里面写一些相关的重置样式,
例如:html,body{margin:0,padding:0;}清除浏览器默认自带的内外边距。
还有ul,li{font-style:none;}等等,说有哪些方式:无非就是那几种,内联,内嵌,外联,外部(@import方式),或者脚本js等,但是一般最常用的还是使用外联方式。
『肆』 美化百度搜索代码使用css 或直接在代码上美化都可以
<input type=text name=word size=30 style=“width:410px;height:30px.border:2px solid #颜色;”>
<input type="submit" value="网络搜索" style=“width:85px;height:34px;border-left:1px insert;background-color:#颜色;”>自己加上颜色的值吧
『伍』 CSS优化,如何写出高效整洁的CSS代码
CSS优化主要的好处
1、提高CSS文件的易读性
2、减小CSS文件的大小
3、能够相对的加快浏览器的加载速率
CSS学起来并不难,但在大型项目中,就变得难以管理,特别是不同的人在CSS书写风格上稍有不同,团队上就更加难以沟通,为此总结了一些如何实现高效整洁的CSS代码原则。
『陆』 如何用css美化表单
解决方法:用普通标签模拟,背景图设置在普通标签里面,表单功能还是用input来实现,交互功能得用JavaScript来实现。换句话说,CSS控制普通标签的样式来美化表单,JavaScript实现表单交互功能。
案例分析:
移动端兼容 - 调用相册的按钮样式处理
具体情形:<input type="file" accept="image/*;capture=camera">或者<input type="file" capture="photo">设背景图无效。在我们的移动端网页当中,会有上传照片的操作需求。此时会使用到文件类型的input文本框,但是不同的系统不同的浏览器在样式上均不相同,而且,设置背景图也没有效果。
解决方法:通过设置opacity为0来进行模拟,背景图设置在其他标签里面。换句话说样式用普通标签模拟,功能用input来实现。
测试效果图:

《CSS美化表单大集锦》
『柒』 怎样用cssselect下拉框的美化
用cssselect下拉框的美化
这个可以换种方式实现,首先select的样式每个浏览器都有其默认的样式,需要先去除这些默认样式,其次,select里面的样式诸如箭头,下拉框等等的样式,这里提供一种思路,就是在select的外层添加一个div,对这个div元素设置样式,select元素则是没样式,从而达到一种掩眼法的效果,实现方式如下:
<!-- html 布局 -->
<div id="selectStyle">
<select id="select">
<option>option 1</option>
<option>option 2</option>
<option>option 3</option>
<option>option 4</option>
<option>option 5</option>
</select>
</div>
首先要去掉 #select 的默认样式:
/* 去掉默认样式,设置新的样式 */
#select{
display:block;
width:100%;
height:100%;
box-sizing:border-box;
background:none;
border:1px solid #222;
outline:none;
-webkit-appearance:none;
padding:0 5px;
line-height:inherit;
color:inherit;
cursor:default;
font-size:14px;
position:relative;
z-index:3;
}
#select option{
color:#222;
}
#select option:hover{
color:#fff;
}
#select option:checked{
background:#535353;
color:#fff;
}
然后在外层div#selectStyle设置自定义样式
#selectStyle{
display:block;
margin:0 auto;
overflow:hidden;
height:30px;
width:240px;
border-radius:0;
background:#535353 url("箭头图片地址") right center no-repeat;
background-size:auto 80%;
color:#fff;
line-height:2;
/* 如果不想加图片,
则可以设置一个自己的三角形样式,
如下的自定义方式,
见代码1 */
position:relative;
z-index:1;
}
/* 代码1 */
#selectStyle:before{
position:absolute;
z-index:1;
top:50%;
right:10px;
margin-top:-2.5px;
display:block;
width:0;
height:0;
border-style:solid;
border-width:5px 5px 0 5px;
border-color:#fff transparent transparent transparent;
content:"";
}
/* 代码1 */
#selectStyle:after{
position:absolute;
z-index:1;
top:50%;
right:10px;
margin-top:-3.5px;
display:block;
width:0;
height:0;
border-style:solid;
border-width:5px 5px 0 5px;
border-color:#535353 transparent transparent transparent;
content:"";
}
以上就是自定义select样式的方法;
同时也可以完全不要select这个元素使用div+css来自定义一个跟select一样效果的下拉框(需要Javascript辅助)。
『捌』 如何用CSS美化输入框的方法
为了达到更好的交互效果,提高用户友好度,对文本框输入框之类的美化工作是很必要的。 一般的美化工作可以直接通过使用CSS完成,方法也十分简单,如下: 1、首先制作一张输入框的背景图,如上图所示。 2、添加按钮的Html代码: <input type=button class=Selectbg 3、然后用css代码将它定义:<stylebody{font-size:12px; } .Selectbg{border:none; width:150px; height:20px; background-image:url(image.gif); text-align:left;line-height:20px; }</style 在写CSS代码的时候要注意,如果背景图中带边框,一定要将输入框的边框去掉,否则会显示默认边框;其次还要将高度和行高定义好,否则点击输入框后文字的位置会很难看。
『玖』 css美化网页元素中常用的样式修饰有哪些
嵌入式样式表
内联样式表
外联样式表
『拾』 求css通用代码,美化我的网站
只有看着你的html文件才能去配置css文件,配合相应的图片等。不然只能提供大体的框架,效果不理想的
