Here I have summarized 20 commonly used CSS styles that I often use in projects. They are all personal experiences. I share them with you here, hoping to be helpful to everyone
1. Force text to be displayed in a single line: white-space:nowrap;
2. Set the overflow text to be displayed as an ellipsis mark: text-overflow:ellipsis; (Note: text-overflow:clip | ellipsis | ellipsis-word ; (newly added in css3) where clip means directly cutting the overflowing text; value ellipsis means when the text overflows, an omission mark (...) is displayed, and the omission mark replaces the last character; value ellipsis-word means that when the text overflows, the omission mark (...) is also displayed. The difference is that the omission mark replaces the last word)
3. For example, a piece of code: e1b56a1c06f517d8a0e17306668ca118237108f1ef7d7a41515987f25c0284995db79b134e9f6b82c0b36e0489ee08ed When you click on the picture in the a tag, there is a dotted frame, and the picture in IE also has a border ,How to solve? Solution: a{outline:none;}//Mainly for browsers such as Firefox, but not IE img{border:0;} a:active{noOutline :expression(this.onFocus=this.blur());}//Solve the dotted box in IE6 and IE7.
For the a tag, the generally simple solution is: Add js control to the a tag. When the a tag is focused, the focus is forced to be cancelled. At this time, the a tag will naturally not There will be a dotted box.
024db780eb8416657e62fa483f255092Test5db79b134e9f6b82c0b36e0489ee08ed But when there are too many connections, add this code one by one Unpractical
4.html There is a gap caused by horizontal carriage returns in the two images in 4.html. How can I remove it so that there is no gap?
For example: p width 300px; img width 100px; border:0px;
The code is as follows:
e388a4556c0f65e1904146cc1a846bee 6ed09268cbdd0015bce8dcbbdfa9bfe453faedac456a1536a2726f80512ef6d06ed09268cbdd0015bce8dcbbdfa9bfe4 94b3e26ee717c64999d7867364b1b4a3 //The above situation shows exactly three pictures94b3e26ee717c64999d7867364b1b4a3
e388a4556c0f65e1904146cc1a846beee388a4556c0f65e1904146cc1a846bee ; 6ed09268cbdd0015bce8dcbbdfa9bfe4 ; 6ed09268cbdd0015bce8dcbbdfa9bfe4 ; ##In this case, it is impossible to display three pictures horizontally because the carriage return causes a gap between the two pictures. The solution is to make the image
float
.
5.css overflow:hidden invalid solution in ie6 and ie7Cause:
When the style of the direct child element or subordinate child element of the parent element has
9bf863f03104f600c829dc53d6b87497...f16b1740fad44fb09bfe928bcc527e08The URL of the background image=is the path URL
595fbdba6efc01af42878d7c67f4bef3...f16b1740fad44fb09bfe928bcc527e08Set the background color of the table9b00471ed6e2430b3ab3b35d4c08b2ad...f16b1740fad44fb09bfe928bcc527e08Set the color of the table border9a5c242c21ac9fd837eb4533115d2693...f16b1740fad44fb09bfe928bcc527e08Set the color of the dark border of the table d049e7beff2206fc930287a674513079...f16b1740fad44fb09bfe928bcc527e08Set the color of the bright border of the table 77fb8f1cfdb8674b1139d20ff2214b84...f16b1740fad44fb09bfe928bcc527e08 Specify the distance between the content and the grid (use numbers) 25b96734fbf1ea2dc9c8796c73b29fcd...f16b1740fad44fb09bfe928bcc527e08Specify the distance between the grid and the grid (use numbers) < ;table cols=Parameters>...f16b1740fad44fb09bfe928bcc527e08Specify the number of columns in the tablebaf16e02d02e0b9e09ec73323f1581d7...f16b1740fad44fb09bfe928bcc527e08Set the display method of the table outlinecd103503fd90c8b2552a4265f0e504ed...f16b1740fad44fb09bfe928bcc527e08Specify the width size of the table (use a number) 4e624cb70089a2def2a28dc20c12c837. ..f16b1740fad44fb09bfe928bcc527e08Specify the height of the table (use numbers)93966c3b9fde097f1a742ee63f795237...b90dd5946f0946207856a8a37f441edfSpecify the number of columns in the cell merge column (use numbers) b901786a6377c9b8e80942735d640559...b90dd5946f0946207856a8a37f441edfSpecifies the number of columns (using numbers) for the merged columns of the cell
The text-transform property controls the case of text. Possible values Value Description none Default. Text that defines standards with lowercase and uppercase letters. capitalize Each word in the text begins with a capital letter. uppercase defines uppercase letters only. lowercase definition has no uppercase letters, only lowercase letters. inherit specifies that the value of the text-transform attribute should be inherited from the parent element .
input{ background-color:expression(this.type=="text"?'#FFC':''); } c. Use javascript script to implement (feel unnecessary, omit...)
12: text-stroke [ text-stroke-width]: Set or retrieve object The stroke thickness of the text in [ text-stroke-color ]: Set or retrieve the stroke color of the text in the object
13: text-stroke text-stroke (text stroke) and text -fill-color (text fill color) Note: Currently these two properties are only supported by Safari and Chrome of the webkit kernel, for example: -webkit-text-stroke: 3.3px #2A75BF; text-fill-color: Color value, which is almost the same as the color attribute. Use text-fill-color and color attributes at the same time, text-fill-color will overwrite the color value of the color attribute; text-fill-color can use transparent values, that is: text-fill-color: transparent
14:text-shadow text-shadow:0px 0px 0px #333333 ; The attribute values are: horizontal displacement (supports negative values), vertical displacement (supports negative values), blur radius, shadow color text-shadow can set multiple shadows for the same text, and box -Shadow is similar, separated by commas ",", the previous setting effect is on top of the latter setting effect.
17. CSS :first-child selector,:last-child selector,:nth-child (IE7,8 is invalid, not recognized) :nth-child(2) selects which label, "2 can be the number you want" :nth-child(2n) selects even labels, 2n can also be even :nth-child(2n-1) selects odd labels, 2n-1 can be odd :nth-child(3n+1) customizes the selection label, 3n+1 means "pick one out of every two"
The first parameter: the color of the starting position of the gradient
The second The first parameter: the color of the gradient end position
The third parameter: the type of gradient
0 represents the vertical gradient 1 represents the horizontal gradient 19 IE8 does not recognize the rgba writing method
20 RGB color and HSL color of css3 The principle of RGB color is to form a color by defining different red, green and blue values. color:rgb(254,2,8); HSL declares color through hue, saturation, and brightness modes. color:hsl(359,99%,40%);
If you need to set a transparent background, you can use them:
The above is the detailed content of Integrate 20 common CSS/CSS3 properties. For more information, please follow other related articles on the PHP Chinese website!
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn