如何获得此CSS工作? [英] how to get this CSS work?

查看:85
本文介绍了如何获得此CSS工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的ASP页面

%@页面标题=关于我们" Language ="C#" MasterPageFile =〜/Site.master" AutoEventWireup ="true"
    CodeFile ="SignUp.aspx.cs" Inherits ="About"%>
<   asp:Content     ID   ="   runat   服务器"  ContentPlaceHolderID    HeadContent" <   asp:Content     ID   ="   runat   服务器"  ContentPlaceHolderID    MainContent" <!-  内容部分 <   div     ="   center"    signup_form_heading" > 
<   h1  > 登录到Vid流<  /h1  > 
<   p  >  Lorem Ipsum是只是伪造印刷品的文字和
排版行业.<  /p  > 
<  /div  > 
<  表单     ="  <   div     ="   center"   注册表单" <   ul  > 
<   li  >  <  标签 > 名称:<  /label  >   span  <  输入   类型  ="      ="   class    txt字段"    ="   if(this.value =='Name'){this.value =' '; }"    ="  / <  /span  >  <  /li  > 
<   li  >  <  标签 > 电子邮件:<  /label  >   span  <  输入   类型  ="      ="   class    txt-field"    ="   if(this.value =='User Name'){this.值=''; }"    ="  / <  /span  >  <  /li  > 
<   li  >  <  标签 > 密码:<  /label  >   span  <  输入   类型  ="      ="   class   密码"  onfocus    if(this.value =='password'){this.value =''; }"    ="  / <  /span  >  <  /li  > 
<   li  >  <  标签 > 密码:<  /label  >   span  <  输入   类型  ="      ="   class   密码"  onfocus    if(this.value =='password'){this.value =''; }"    ="  / <  /span  >  <  /li  > 
<   li  >  <   div  >  输入 类型  ="      ="      =" 



这是我的css文件

. signup_form_heading  {
宽度 :  297px; 
浮动 : 左; 
背景 :  url(../images/db-border .gif)repeat-x bottom; 
填充底部 :  6px; 
边距 :  20px; 
}
. signup_form_heading   h1  {
高度 :  46px; 
背景 :  url(../images/login-heading .png)不重复的左上角; 
文本缩进 : -9999px; 
边距 :  8px; 
}
. signup_form_heading   p  {
行高 :  18px; 
填充底部 :  12px; 
字体家族 :  Arial,Helvetica,无衬线; 
颜色 : #00555a; 
}
.注册表单
{
浮动 : 没有; 
宽度 :  297px; 
填充顶部 :  5px; 
}
.注册表单  li  {
浮动 : 左; 
宽度 :  297px; 
填充底部 :  13px; 
}
.注册表单  li   label  {
显示 :  block; 
浮动 : 左; 
宽度 :  81px; 
字体粗细 : 粗体; 
字体大小 :  12px; 
颜色 : #00555a; 
字体家族 :  Arial,Helvetica,无衬线; 
行高 :  27px; 
}
.注册表格  li   span  {
显示 :  block; 
浮动 : 左; 
宽度 :  211px; 
高度 :  27px; 
背景 :  url(../images/bg-input -usr.png)不重复的左上方; 
}
.注册表单  li   span  输入 {
浮动 : 左; 
宽度 :  191px; 
高度 :  15px; 
字体大小 :  11px; 
颜色 : #787979; 
边框 : 没有; 
字体家族 :  Arial,Helvetica,无衬线; 
背景 : 没有; 
填充 :  6px 10px; 
}
.注册表单  li   span  输入.密码 {
字体大小 :  18px; 
}
.注册表单  li   div  {
浮动 : 左; 
向左填充 :  81px; 
宽度 :  211px; 
填充顶部 :  5px; 
填充底部 :  2px; 
}
.注册表单  li   div  标签 {
字体重量 : 正常; 
宽度 :  auto; 
字体大小 :  11px; 
行高 :  15px; 
颜色 : #6f6f6f; 
宽度 :  120px; 
}
.注册表单  li   div  标签 输入 {
浮动 : 左; 
右边距 :  6px; 
宽度 :  15px; 
高度 :  15px; 
行高 :  0; 
字体大小 :  0; 
}
.注册表单  li   div   a  {
浮动 : 正确; 
显示 :  block; 
宽度 :  90px; 
文本对齐 : 右; 
}
.注册表单  li   div  输入. login-btn  {
浮动 : 左; 
宽度 :  87px; 
高度 :  29px; 
背景 :  url(../images/btn-login .gif)左上无重复; 
边框 : 没有; 
文本缩进 : -9999px; 
行高 :  0; 
字体大小 :  0; 
光标 : 指针; 
} 


我无法将样式更改为我的表单.我应该怎么做?

解决方案

您将css文件link到了页面吗?在ASP页面中,没有提供样式表文件链接的位置.
要添加CSS文件,请在设计模式下打开asp页面,然后将样式表文件从解决方案资源管理器中拖放到asp页面.

希望这对您有帮助


您需要在<head></head>
之间的一行下面写

<link href="yourcssfile.css" rel="stylesheet" type="text/css" />


将会在partuclar页面级别播放
看看此-[将CSS应用于Asp.net应用程序] [^ ]文章,将帮助您学习如何使用CSS.


this is my asp page

%@ Page Title="About Us" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="SignUp.aspx.cs" Inherits="About" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<!--Content Section -->
<div align="center" class="signup_form_heading">
<h1>Login to Vid Stream</h1>
<p>Lorem Ipsum is simply dummy text of the printing and
typesetting industry.</p>
</div>
<form action="#">
<div align="center" class="signup-form">
<ul>
<li><label>Name:</label><span><input type="text" value="Name" class="txt-field"  onfocus="if(this.value == 'Name') { this.value = ''; }"  önblur="if(this.value == '') { this.value = 'Name'; }" /></span></li>
<li><label>Email:</label><span><input type="text" value="User Name" class="txt-field"  onfocus="if(this.value == 'User Name') { this.value = ''; }"  önblur="if(this.value == '') { this.value = 'User Name'; }" /></span></li>
<li><label>Password:</label><span><input type="password" value="password" class="password" onfocus="if(this.value == 'password') { this.value = ''; }"  önblur="if(this.value == '') { this.value = 'password'; }" /></span></li>
<li><label>Password:</label><span><input type="password" value="password" class="password" onfocus="if(this.value == 'password') { this.value = ''; }"  önblur="if(this.value == '') { this.value = 'password'; }" /></span></li>
<li><div><input type="submit" value="Sign Up" class="signup-btn" /></div></li>
</ul>
</div>
</form>
<br class="clear" />
<!--Content Section End -->



this is my css file

.signup_form_heading {
width:297px;
float:left;
background:url(../images/db-border.gif) repeat-x bottom;
padding-bottom:6px;
margin-bottom:20px;
}
.signup_form_heading h1 {
height:46px;
background:url(../images/login-heading.png) no-repeat left top;
text-indent:-9999px;
margin-bottom:8px;
}
.signup_form_heading p {
line-height:18px;
padding-bottom:12px;
font-family:Arial, Helvetica, sans-serif;
color:#00555a;
}
.signup-form
{
float:none;
width:297px;
padding-top:5px;
}
.signup-form li{
float:left;
width:297px;
padding-bottom:13px;
}
.signup-form li label {
display:block;
float:left;
width:81px;
font-weight:bold;
font-size:12px;
color:#00555a;
font-family:Arial, Helvetica, sans-serif;
line-height:27px;
}
.signup-form li span {
display:block;
float:left;
width:211px;
height:27px;
background:url(../images/bg-input-usr.png) no-repeat left top;
}
.signup-form li span input {
float:left;
width:191px;
height:15px;
font-size:11px;
color:#787979;
border:none;
font-family:Arial, Helvetica, sans-serif;
background:none;
padding:6px 10px;
}
.signup-form li span input.password {
font-size:18px;
}
.signup-form li div {
float:left;
padding-left:81px;
width:211px;
padding-top:5px;
padding-bottom:2px;
}
.signup-form li div label {
font-weight:normal;
width:auto;
font-size:11px;
line-height:15px;
color:#6f6f6f;
width:120px;
}
.signup-form li div label input {
float:left;
margin-right:6px;
width:15px;
height:15px;
line-height:0;
font-size:0;
}
.signup-form li div a {
float:right;
display:block;
width:90px;
text-align:right;
}
.signup-form li div input.login-btn {
float:left;
width:87px;
height:29px;
background:url(../images/btn-login.gif) no-repeat left top;
border:none;
text-indent:-9999px;
line-height:0;
font-size:0;
cursor:pointer;
}


i cant get the styles to my form. what should i do??

解决方案

Did you link the css file to your page?


Here in the asp page no where you are giving the link of stylesheet file.
To add your CSS file open your asp page in design mode then drag and drop your stylesheet file from solution explorer to the asp page.

Hope this will help you


You need to write below line between <head></head>

<link href="yourcssfile.css" rel="stylesheet" type="text/css" />


that will aplay to partuclar page level
take a look at this-[Applying CSS to Asp.net Application][^] article which will help you to learn how to use CSS.


这篇关于如何获得此CSS工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆