How to use ASP. NET-CSS styles

Source: Internet
Author: User


CSS styles are roughly divided into three types

Let's take a look at an overall picture.


 

 

1. Use a connection

There are two sending methods:

A uses the link label

Write the style rules in the. CSS style document, and then use the <link> label to introduce

The method is as follows:

<LINK rel = "stylesheet" href = "CSS file path"
Type = "text/CSS"/>

You can drag a CSS file directly to an HTML page.

Rel = "stylesheet" indicates that the association style between the link and href is a style sheet file.
Type = "text/CSS" indicates that the file type is a style sheet.

The location is usually in the

 

 

 

B use @ import to import


Just like importing a namespace. In Zai <style>... </style>

Styletype = "text/CSS">

<! --

@ Importurl (the address, path, and file name of the imported style table );

-->

</Style>

For example:

<Styletype = "text/CSS">

<! --

@ Importurl (http: // yourweb/example.css );

-->

</Style>

Note that the semicolon at the end of the line is absolutely indispensable!

 

 

2 Use Style Attribute

Add the style attribute directly to individual element labels or rows.

The call method is as follows:

<Element name style = "attribute 1
: Attribute value 1; Attribute 2: attribute value 2;... "> </element name>

The style syntax is identical to the independent style syntax. For example

<Divstyle = "width: 30px; color: red; font-size: 15px;"> </div>

 

The advantage of this usage is that in the labels of smart applications, the disadvantage of OME is that there is no uniformity of the entire file;

 

3 Use Style Tag

Place the style inHeadElementStyleLabel,AndBodyLevel

Syntax:

<Style type = "text/CSS">

<! --CSS

Style Sheet

-->

 

</Style>
 

The following is an example. <Head> <title> CSS call method </title> <style>. content {background-color: # cccccc; font-size: 14px; width: 240px; Height: 80px; color: Blue; text-align: center ;} </style> 

Generally, the entire <style>... </style> structure is written in the

 

The above shows how to use CSS styles. Thank you for your correction.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.