Several common CSS styles on webpages

Source: Internet
Author: User
Tags comments

· 1. align the two ends of the text: text-align: justify; text-justify: inter-ideograph;
· 2. fixed width Chinese character truncation: overflow: hidden; text-overflow: ellipsis; white-space: nowrap .) (IE5 or above)
· 3. fixed-width Chinese character (word) lines: table-layout: fixed; word-break: break-all; (IE5 or above)
· 4. <acronym style = "cursor: help" title = "Enter the text to be prompted"> text </acronym> move the cursor over the text to see the effect. This effect can be seen on many foreign websites, with few in China.
· 5. The image is set to translucent:. halfalpha {background-color: #000000; filter: Alpha (Opacity = 50)}. The image is tested in IE6 and IE5, and FF fails.
· 6. FLASH transparency: Select swf to open the original code window, before </object>, enter <param name = "wmode" value = "transparent"> we often use to hover the mouse over an image to make the image brighter, you can use the image replacement technique or the following filter. The code is as follows:
. Pictures img {filter: alpha (opacity = 45 );}
. Pictures a: hover img {filter: alpha (opacity = 90 );}
· If the text is too long, the excessive text will be displayed as ellipsis: IE5 and FF are invalid, but can be hidden. IE6 is valid.
<Div style = "width: 120px; height: 50px; border: 1px solid blue; overflow: hidden; text-overflow: ellipsis">
<NOBR> For example, a row of text is long and cannot be displayed in a table. </NOBR>
· Replace the comments with the following comments: <! -- [If! IE]>
Put your commentary in here...
<! [Endif] -->
· How to use CSS to call the external font syntax: @ font-face {font-family: name; src: url (url); sRules}; values:
Name: font name. Any possible font-family attribute values
Url: specifies the OpenType font file with an absolute or relative url.
SRules: style sheet definition

Related Article

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.