CSS advanced tutorial @ Rules

Source: Internet
Author: User

The at (@) rule injects all CSS rules into a compression capsule and applies them to specified items. Oh.
Import
Import at rules will be swallowed into another style sheet. For example, if you want to add another style sheet to an existing one, you can do this:
@ Import url(addonstyles.css );
This is often used to replace the <link> tag connecting CSS to HTML. Essentially, it is an internal style sheet, which looks like this:
<Style type = "text/css" media = "all"> @ import url(monkey.css); </style>
The advantage of doing so is that some old browsers such as Netscape 4. x does not accept the at rule and does not connect to the style sheet. Therefore, if you have a well-structured tag, only HTML with simple functions is left (although there is no style ).
Media type
The media at rule applies the content to the specified media, such as printing. For example
@ Media print {
Body {font-size: 10pt; font-family: times new roman, times, serif ;}
# Navigation {display: none ;}

Media types can be:
All-all media types in the sun, up, around, and inside.
Aural-speech synthesizer.
Handheld ── handheld devices.
Print ── printer.
Projection ── projector.
Screen -- computer screen.
You can also use braille, embossed, tty, and TV ).
Character set
Character set charset at rules set the character encoding of an external style, which should appear at the top of the style, roughly like this: @ charset "ISO-8859-1 ";
Font appearance
Font-face at rules are used to describe an external font that can embed CSS in detail.
It must have a font-family font that can be referenced. The value can be the existing font name of the system (this font will be overwritten in this case ), it can also be a brand new name. To embed a font, you must use the src descriptor. Other descriptors of the font appearance at rule are some conditions for using the font. For example, add a font-weight: bold style to the at rule. If the font-weight attribute is set to bold, the src of font-family applies this rule to the selector with the font-family attribute.
The at rule using the font shape looks like this:
@ Font-face {
Font-family: somerandomfontname; src: url (somefont. eot );
Font-weight: bold;

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.