您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

CSS样式之ASP.NET的使用

2024/2/29 23:50:29发布15次查看
1  使用link标签去调用样式,即调用css文件中的样式,可以直接将css文件拖拽到html页的head下面     此方法先加载css,后加载html<head runat="server"> <title>网页标题</title> <link href="css/default.css" rel="stylesheet" type="text/css" /> </head>
2 使用style标签 <head runat="server"> <title>网页标题</title> <link href="css/default.css" rel="stylesheet" type="text/css" /> <style type="text/css"> body { width:100%; } </style> </head>
3 import加载,先加载html,后加载css <style type="text/css"> @import url('css/default.css'); </style>
4 在default.css中的使用 1 如果只写控件的类型,表示该类型的控件都用这样的样式
2 如果想对某一控件进行设置样式使用 #
举个栗子: defaullt.css 文件
body { padding: 0px; margin: 0px; width:960px; height:auto; display:block; margin-left:auto; margin-right:auto; } #p_top { width:100%; height:80px; margin:0 auto; background-color:white; display:block; } #p_mid { width:100%; height:auto; margin:0 auto; background-color:white; display:block; min-height:420px; } #p_footer { width:100%; height:30px; } #select,#insert,#delete,#update { width:90px; margin-left:auto; margin-right:auto; height:90px; font-size:15px; border: 3px solid #33ccff; } #select:hover,#insert:hover,#delete:hover,#update:hover { cursor:pointer; background-color:#33ccff; }
5 对于控件而言 可以使用属性加载样式 1 使用style属性 直接使用 style=" width:auto; height:auto; margin-left:auto; margin-right:auto;"
2 使用class 调用head里的样式
3 使用cssclass 调用head里的样式
<style type="text/css"> .bt { width:80px; height:25px; border:none; } .bt:hover { cursor:pointer; background-color:#33ccff; } .closed { border-style: none; height:21px; width:21px; background-image: url('/images/closed.png'); background-repeat:no-repeat; } .closed:hover { cursor:pointer; } </style>
6 后台为前台按钮添加样式
bt.attributes.cssstyle.value = "background-color:gray;";
7 可以用 迭代写法 表示设置 menu下的ul下的li的 样式
#menu ul li { width:100%; border:1px dotted gray; margin:0; padding:0; }
以上就是css样式之asp.net的使用的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product