Style Code')"; 2. ""; 3 , "@import "file path""."/> Style Code')"; 2. ""; 3 , "@import "file path"".">

Home  >  Article  >  Web Front-end  >  How to introduce css style into asp

How to introduce css style into asp

青灯夜游
青灯夜游Original
2021-07-22 13:53:272998browse

Method: 1. "Response.write('c9ccee2e6ea535a969eb3f532ad9fe89Style Code531ac245ce3e4fe3d50054a55f265927')"; 2. "16d88e0bf78c9cb43ea0a6870dce59b8"; 3. "@import "File path"".

How to introduce css style into asp

The operating environment of this tutorial: Windows 7 system, CSS3 version, Dell G3 computer.

asp method of introducing css style

1. Dynamic loading method

Response.write(&#39;<style>...</style>&#39;)

2. Use the link tag to introduce

and write the following statement in the asp file that needs to be called:

<link rel="stylesheet" type="text/css" href="css文件路径">

3. Use @import to import

Write the following statement in the asp file that needs to be called:

<style>
@import "css文件路径"
</style>

It should be noted that the code for the @import import method must be located between c9ccee2e6ea535a969eb3f532ad9fe89531ac245ce3e4fe3d50054a55f265927

#asp uses css style

Just like a normal program, just add a class name to the element

<button class="success">OK</button>

Dynamic transformation:

In asp.net, sometimes it is necessary to dynamically transform CSS, for example, sometimes when making personalized pages, you can do this

1) Still need to Add the tag statement in the head tag:

<link id="MyStyleSheet" rel="stylesheet" type="text/css" runat="server" />

2) After that, in the page where the CSS is to be replaced, use the following js code

void fuction
{
   MyStyleSheet.Attributes.Add("href","/css/flostyle.css")
}

3) The page can dynamically control the css file to be referenced. .

(Learning video sharing: css video tutorial)

The above is the detailed content of How to introduce css style into asp. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn