Javascript - css Cascading Style Sheets
Related Tags:
Kuba men, Kuba, not crimes ~~~~~~~, today, I cried, cried a psychological some really depressed, pressure Tingda. Nowhere release. Really too tired, too painful, I feel that My life until now, the living is a failure. Alexander the Great, I liked the phrase: "I came, I suffered, I successed.! (I came to this world, I have suffered all kinds of hardships, finally, I conquered of this world), I came to this world, I was subjected to all kinds of hardships, when I can conquer the world???
This knowledge learned something very simple, it is difficult to apply what they have learned and now a bit lazy in my notes, there were two notes, a handsheet, an electronic, trouble ~ ~
css Cascading style sheet:
Css Cascading Style Sheets is the abbreviated, it can easily set apart from page elements to Display the location and format, and even have filters, image fade out, all out on the website gradual effect, in a nutshell, is the css Web pages appear to achieve the same layout and word control.
Css set up some of the ways:
1 of the style sheet (Inline Styles) set directly html Text labels style attributes, recommendations In "head> add a label on <meta http-equiv =" Content-Style-Type "content =" text / css " >
2 embedded style sheet (Embedded style sheets)
3 Waibuyangshibiao (Linked style sheets)
4 Enter Style Sheets (imported style sheets)
Embedded style sheet:
<head>
<style Type="text/css" media="screen,projection">
<!--( Support style browser does not read at the Notes to prevent the browser does not support that below)
P (FONT-SIZE: 20pt; COLOR: blue; FONT-FAMILY: 10 lines; LIST-STYLE-TYPE: circle; TEXT-DECORATION: underline)
-->
</ Style>
</ Head>
In "style> </ style> labels on each style in the definition of the Rules of Basic format is as follows:
(Selector property: value; property: value ;....}
Selector: When the definition of a style rules, must be designated by the rules of this style role of the web Element in the definition of the rules of a page element is the selector (choice), is to choose the style rules in the role of the page elements.
Property: who will be designated to be revised pattern name, which is css attributes, such as color, font-size;
Value: assign property values, css attribute values.
Waibuyangshibiao:
First prepare a text.css documents, the contents are as follows:
P (FONT-SIZE: 20pt; COLOR: blue; FONT-FAMILY: 10 lines; LIST-STYLE-TYPE: circle; TEXT-DECORATION: underline)
Then prepare to use the style sheet document page document, page document with the assumption that documents test.css placed in the same directory, a Web page document reads as follows:
<html>
<head>
<link Rel="Style Sheet" href="text.css" type="text/css" media="screen">
</ Head>
<body>
<p> This is a css text. </ P>
</ Body>
</ Html>
Input style sheet can use the @ css import statement will be a Waibuyangshibiao document (css) entered into another css document, the document was imported css style rules in the definition of a statement on the input to css part of the documentation. Can also use the @ import statement will be entered into a css document page document <style> </ style> label, css document was imported in the form of rules on the definition of a statement <style> </ style> on the label statements.
@ Import using the example sentence statement is as follows:
<STYLE TYPE="text/css" MEDIA="screen,projection">
<! --
@ Import url (http://www.it314.org/style.css);
@ Import url (/ stylesheets / style.css);
P (background: yellow; color: black)
-->
</ STYLE>
Style rules for the choice of
HTML selector: that as a selector to HTML tags, HTML tags used as a selector is the css style web application of all the labels, and most of the definition of style.
class selector: To create an HTML tags by the various website elements into several categories, the HTML tags will need the class attribute is set to a different value. For example:
<p Class="stop"> paragraph1 </ p>
<p Class="warning"> paragraph2 </ p>
<p Class="normal"> paragraph3 </ p>
In the style sheet, it can be a HTML tags for the various categories defined style rules:
<STYLE>
P.stop (color: red)
P.warning (color: yellow)
P.normal (color: green)
</ STYLE>
In the style sheet, it can be for a certain category of all HTML tags definition of style rules:
<h1 Class="blueone"> blue topic </ h1>
<p Class="blueone"> blue paragraphs </ p>
<STYLE>
. Blueone (color: blue)
</ STYLE>
id selector:
ID attribute to a particular definition of HTML elements, a web page in the document there can be only one element can use one ID attribute values, ID Selector is to define the rules of style statement with a choice of the ID attribute values HTML element.
<span ID="yellowone"> text here </ span>
In the style sheet, the ID value of yellowone HTML element definition of the rules of the style statement as follows:
<STYLE>
<! --
Color.yellow) (# yelowone
-->
</ STYLE>
Lessons Learned:
ID Selector only a single element of HTML tags set style rules and regulations, with one of the limitations in CSS should be used as little as possible. Javascript and CSS-P ID can be the basis of this value and Position to manipulate this particular HTML tags, ID attribute in Javascript will be in widespread use. If pages are only in certain media output when it is necessary to form a single element of a set, it should replace the use of ID Selector set directly HTML style attribute of the element within the style sheet.
In the use of the web and connecting embedded style sheet, a certain element of the need to show results in the style sheet has been related to the definition of re-setting style, which used to use in the style sheet to set directly HTML style attribute elements .
Association selector selector associated with the portfolio is an option for separated by a space of two or more options for the composition of a single string, such as:
P EM (background: yellow)
The "P EM" is associated choice, it stressed that the text of paragraph (<em> </ em> on the labelling of the contents of) the Background of yellow, and other places in the text that were not affected.
Association selector definition of the priority rules of style than of a single definition of the style of choice for the rules of high priority, even in the P EM (background: yellow) definition of the latter part of the rules of the following forms: EM (background: green) However, paragraph tags (<p ") in the definition of that text still used yellow background.
Portfolio Selection of style sheets in order to reduce duplication of the statement, in a style sheet can be defined rules of a number of statements in the portfolio choice, not a choice between using a comma-separated. For example, H1, H2, H3, H4, H5, H6, TD (color: red;)
Pseudo-element selector pseudo-element selector on the same HTML refers to the various elements of the state and it contains some of the contents of a definition of the way. For example: the hyperlink labelled normal state (no heat and moves before), visited the state, selected state, move your cursor over the text hyperlinks on the state, for the first paragraphs of the letter and the first trip, pseudo-element can be used Selector to define.
Use as a pseudo-element rules of the style of choice for the definition formats: HTML elements: pseudo-element (attributes: value)
Pseudo-common elements:
A: active hyperlinks to the selected state
A: hover the cursor moved to the hyperlinks on the state.
A: link hyperlink to the normal state
A: visited visited hyperlinks state.
P: first-line paragraphs in the first lines of text.
P: first-letter paragraphs of the first letter of choice for pseudo-elements used in conjunction with the format:
HTML elements. Category: pseudo-element (attributes: a value) only team HTML element type of pseudo-element effective.
Style Notes and effective rules of style sheets in the Notes:
"/ * Notes to the contents * /" format Notes, the Notes can not be nested.
Style rules of succession:
All in a nested HTML tags in the HTML tags will inherit the style of the outer label set rules.
Style rules of priority:
ID selector> class selector> HTML tags selector. In the style sheet> embedded style sheet> link style sheets.
Style attributes Category:
Background text Font layout position on the edge of other fonts:
Font-family: Setting font name, to set up a number, not a comma-separated between.
Font-size: Setting text size. Absolute size is set to xx-small, x-small, small, medium, large, x-large, xx-large in any one. Relative size setting can be larger or smaller. Absolute units: px, mm, cm, in, pt, pc. Relative units: em (the current ratio of Font Size of the original value), ex (letters x height),% (the current percentage of the size of the original fonts)
Font-style: Font Style (normal or italics)
Text-decoration: in the text added to the line, underline, strikethrough, no, and so on, can be multiple, separated by a space.
Font-weight: bold designated size, in units of pounds, can be absolute or relative settings.
Text-variant: Setting capital letters
Text-transform: the first letter of each word capitalized, or all uppercase, lowercase.
Color: Color text of the definition, said three methods: # RRGGBB, rgb (R, G, B), red.
Font: the above put together settings such as P (font: talic bold 12pt serif) the attribute values by a space.
Background
Background-color: Setting the background color, transparent (transparent background color)
Background-image: Setting up a background image. For example, (background-image: url ( 'logo.gif'))
Background-repeat: repeat the background image, or how to repeat. Settings: no-repeat, repeat, repeat-x, repeat-y.
Background-attachment: Background Image content to follow the rolling and rolling. Settings: fixed, scroll;
Backigroud-position: image position. Settings: left, center, right, 20px (20 pixel elements from the left), top, bottom
Background: The above settings with a variety of attributes, such as TABLE (background: # 00cc00 rul (logo.jpg) no-repeat Bottom right)
Text
Word-spacing: Setting the Spacing between words.
Letter-spacing: the spacing between characters
Vertical-align: Vertical Alignment of the text, settings: sub (subscript), super (superscript), the top (with the top alignment), middle, bottom. Also can be high relative to the element attribute percentage.
Text-align: the level of the text alignment. Left, right, center, justify
Text-indent: Setting text of the first line indentation.
White-space: for how to deal with gaps in the text of the characters. Settings: normal (compressed) default mode, pre pretreatment, nowrap only encountered <br> tags before a newline.
Line-height: Setting up the trip to the text of the high percentage that can be used.
Location:
Elements designated location, it is css-p (cascading style sheets positioning), the contents of css css-p is an extension, it can be used to control any web browser elements in the document window in the position.
Position: Setting the positioning elements, settings: absolute absolute positioning, relative relative positioning, GM static positioning (default)
Left: Elements of the left horizontal position.
Top: Setting elements upside display position.
Width: Elements of the display width.
Height: Elements show height.
Z-index: Setting elements cascading sequence, the larger the value shown in smaller above.
Edge
Margin: to set the boundary element and the gap between the size of other elements. Settings: top-margin, margin-right, and margin-bottom, margin-left. One or more can be set, the other set up an effective, not the opposite with the same settings.
Padding: (padding-top and padding-right, padding-bottom, padding-left) to set the boundary element and the gap between the size of the internal content
Border-width: (border-top-width, border-right-width frame elements ......) to set the Width of thin, medium,
Border-color: (border-top-color. ...)
Border-style: (border-top-style. ...) settings: none dotted dashed ......
Border: more than the total settings.
List:
List-style-type: List of designated directory marking patterns. Settings: disc (solid circle), circle (hollow circular), square (box), etc.
List-style-image: Setting up a directory list for the image of the markings. Url attribute is type.
Positon-list-style: Contents List marking display text in the text inside or outside. Settings: inside (internal) and outside (external).
List-style: slightly more than all the attributes of writing.
Other
Cursor: the mouse to move to a position subject shape time. Settings: hand, crosshair, text, wait, and so on.
Filter (css filters)
For the production of the properties of multimedia effects, borders, and other elements such as css forms can be directly used filter effects, similar paragraphs <p> no borders, such as the use of filter elements can not directly effect, but they can be set to use regional element .
Filter parameters:
Alpha control elements of transparency Opacity (transparency levels 0 ~ 100), FinishOpacity (the transparent effect graded 0 to 100)
BlnedTrans: Setting out on the effect of all.
Blur: fuzzy results
Chroma: the designated color settings for transparent.
DropShadow: Setting the shadow effect.
FlipH: horizontal direction reversal. FlipV: vertical direction reversal. Gray: remove the image colors. Invert: color reversal. Light: lighting effects. Xray: image contours.
Glow: Setting edge luminescence similar results.
Mask: The elements on the surface of the coverage element Zhezhao.
RevealTrans: Elements of the initial conversion effect.
Shadow: the establishment of a shadow effect of the other.
Wave: corrugated element to achieve results.
- [Original] css style tips: on the links-style settings!
- CSS style names on the underlined
- How to management style!
- The definition and use CSS style
- Css style (table)
- Css style Xi summary
- Css underscore style
- Css style details, page scrolling Style
- Web2.0 visual style evolution
- Home style developed
- Establish a Web site's style
- Cascading Style Sheets (CSS cascading style sheets)
- Italic style of navigation
- No. 1 on the css style sheet
- Change the style file box
- XHTML CSS style into what?
- Css page of the Style rolling - css style
- Layout style control
- Default style sheet
- CSS - Cascading Style Sheets




