Home > Net >  Why ASP.NET in my new style file doesn't work
Why ASP.NET in my new style file doesn't work

Time:11-25


ASP.NET small white one, I'd like to add a style file, make the label alignment on the web, but increased the style file, found that don't work, don't know where is wrong?



1, add the style pages before rendering is as follows:


2, add the style before Default. Aspx code is as follows:
 & lt; % @ Page Language="c #" AutoEventWireup="true" CodeBehind="Default. Aspx. Cs" Inherits="PartyInvites. Default" % & gt; 



<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "/& gt;



<body>

We 'r e going to have an exciting party. And you' r e invited!








Styles 3, add the following files PartyStyles. CSS
 
Body {

# form1 label {width: 120 px; display:inline-block; }
# form1 input {margin: 2 px; Margin - left: 4 px; Width: 150 px; }
# form1 select {margin: 2 px; Width: 154 px; }
The button [type=submit] {margin - top: 5 px; }
}



After 4, add the following style file PartyStyles. CSS Default. Aspx code revision is as follows:
 
<% @ Page Language="c #" AutoEventWireup="true" CodeBehind="Default. Aspx. Cs" Inherits="PartyInvites. Default" % & gt;



<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "/& gt;

& lt; Link rel="stylesheet" type="text/CSS" href="https://bbs.csdn.net/topics/PartyStyles.css"/& gt;

<body>

We 'r e going to have an exciting party. And you' r e invited!






5, add the style web run after rendering is as follows:

CodePudding user response:

After 4, add the following style file PartyStyles. CSS Default. Aspx code revision is as follows:

 & lt; % @ Page Language="c #" AutoEventWireup="true" CodeBehind="Default. Aspx. Cs" Inherits="PartyInvites. Default" % & gt; 



<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "/& gt;

<link rel="stylesheet" type="text/CSS" href="https://bbs.csdn.net/topics/PartyStyles.css"/& gt;

<body>

We 'r e going to have an exciting party. And you' r e invited!



  • Related