Home > Backend Development > C#.Net Tutorial > How to use Asp.Net-css style

How to use Asp.Net-css style

高洛峰
Release: 2016-11-24 11:43:37
Original
1962 people have browsed it

The use of Css styles is roughly divided into three types


Let’s take a look at an overview picture first

How to use Asp.Net-css style

1 Use the form of connection to call


There are two ways to call:


A Use The link tag


writes the style rules in the .Css style document, and then introduces it with the tag

as follows:

Usually dragging the css file directly to the html page

Concentrate rel="stylesheet" means that the associated style between this link and href is a style sheet file. Type="text/css" means that the file type is a style sheet. The location where it is placed is usually in the

section of the web page.

How to use Asp.Net-css styleB Using @import to import

is just like importing a namespace. Place it in zai

STYLETYPE="text/css">

For example:

It should be noted that the semicolon at the end of the line is absolutely essential!

2 Use the style attribute

Add the style attribute directly to individual element tags or inline


The calling method is as follows:

name>

The syntax of the style is exactly the same as the syntax of the independent style. For example

The advantage of this usage is that it can be used flexibly in tags, but the disadvantage is that There is no unity of the entire document;

3 Use the style tag

Put the style within the style tag in the head element, at the same level as the body


The syntax is as follows:


[html]

Let’s demonstrate it with an example.


CSS calling method



Example: from the page header transfer.



Let’s demonstrate it with an example.

CSS calling method



Example: from the page header transfer.



Usually the entire structure is written in the part of the web page middle. The advantage of this usage lies in the uniformity of the entire document. As long as there is a declared component, the style rule will be applied. The disadvantage is the lack of flexibility in individual components.


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template