C # Call the CSS style Method

Source: Internet
Author: User

1. Page embedding method:

<Style type = "text/CSS">

<! -- Body {Background: white; color: black;} -->

</Style>

You can specify the ID in the style so that other controls can directly call this style!

For example, <style type = "text/CSS" id = "gvcss">

Body {SCROLLBAR-FACE-COLOR: # f6f6f6; font-size: 9pt; SCROLLBAR-HIGHLIGHT-COLOR: # ffffff; SCROLLBAR-SHADOW-COLOR: # cccccc; SCROLLBAR-ARROW-COLOR: #330000; SCROLLBAR-DARKSHADOW-COLOR: # ffffff; text-Decoration: none; scrollbar-3: # cccccccc}

TD {font-size: 9pt; line-Height: 150%; font-family:}

Input {border-Right: #666666 1px solid; border-top: #666666 1px solid; font-size: 9pt; border-left: #666666 1px solid; color: #666666; border-bottom: #666666 1px solid; Height: 18px; Background-color: # ffffff}

</Style>

This. gridview1.cssclass = "gvcss ";

In C #, each control can define its style. Of course, we can also use C #Code. Use a self-written method.

2. External call method:

<LINK rel = "stylesheet" REV = "stylesheet" href = "CSS/style.css" type = "text/CSS" Media = "all"/>

When the CSS style has been defined for the file specified by href, C # automatically recognizes the Style Library. We only need to call the style name when using it. You can preview all available styles in HTML code.

3. Use the double table method to call CSS:

<LINK rel = "stylesheet" REV = "stylesheet" href = "CSS/style.css" type = "text/CSS" Media = "all"/> <style type = "text/ CSS "Media =" all "> @ import URL (CSS/style01.css ); </style>

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.