font-family same value in @font-face */}
4. Text Shadow Text-shadow
Text-shadow can be used to set the shadow effect of text.
Grammar:
Text-shadow:x-offset y-offset blur color; X-offset: Represents the horizontal offset distance of the shadow, whose value is positive when the shadow is offset to the right, and vice versa;
Y-offset: Refers to the vertical offset distance of the shadow, and if its value is positive, the shadow is shifted downward and the inverse is offset upward;
Blur: Refers to
The following small series for everyone to bring the CSS text beyond the specified width after hiding and display as an ellipsis implementation of the sample code. Small series feel very good, now share to everyone, also for everyone to make a reference. Let's take a look at it with a little knitting.
Generic truncation of text (for inline and block):
. text-overflow { display:block;/* inline objects
You should all know that using the Text-overflow:ellipsis property to implement a single line of text overflow displays ellipses (...). Of course, some browsers also need to add width widths properties.
The code is as follows
Copy Code
Overflow:hidden;Text-overflow:ellipsis;White-space:nowrap;
However, this property does not support multiple lines of text overflow display ellipsis, here, according to the applicat
Compatible with Firefox, Opera, chrome text overflow add ellipsis function, as if previously shared several code,However, the compatibility of browsers has not been considered before, now the compatibility of the major browsers are doing well,When the text or character outside the outer div, automatically hide and add the ellipsis, for the front-end development, this is a pretty good
CSS code:Text-overflow:ellipsis;Overflow:hidden;White-space:nowrap;DescriptionText-overflow: Used to set whether to use an ellipsis tag (... ) indicates an overflow of text within the object.white-space:nowrap; Force text to appear on one line.Overflow:hidden; overflow content is hidden.It must be used at the same time. Overflow text display ellipsisAttached: Multi-line Display method:Overflow:hidden;Text-o
This article gives you the content is about CSS implementation of text content if beyond the set width of the ellipsis instead of the rest of the content (code), there is a certain reference value, there is a need for friends to refer to, I hope that you have some help.
CSS beyond a certain width with ellipses ... Instead, how to achieve it? The following cod
Table{Table-Layout:Fixed;}TD{White-space:Nowrap;Overflow:Hidden;Text-Overflow:Ellipsis;}
Principle:
This method is used to solveTable CellThe appearance of too much content mainly involves four CSS styles:
1.Table-layout: fixedBecause the default value of table-layout is auto, that is, the width and height of a table depend on the quantity of its content. If the volume of the content cannot be estimated, the final form of the table cann
Table{Table-Layout:Fixed;}TD{White-space:Nowrap;Overflow:Hidden;Text-Overflow:Ellipsis;}
Principle:
This method is used to solveTable CellThe appearance of too much content mainly involves four CSS styles:
1.Table-layout: fixedBecause the default value of table-layout is auto, that is, the width and height of a table depend on the quantity of its content. If the volume of the content cannot be estimated, the final form of the table cannot
Text more than a few lines on line, this feature almost every text browsing site will be used, the way to achieve it is also a lot, today simply introduce the way to implement it.one-line text does not wrap, and the text is hidden beyond.box-content{overflow: hidden;//文本溢出隐藏text-overflow: ellipsis;//文本溢出显示省略号white-space: nowarp;//不换行}Two. Implement multiple lines of text hiding in the WebKit kernel browser and display ellipsesIn the WebKit kernel, you
, and good compatibility with a variety of coding and Chinese and English mixed-row situation.
Methods in Div:
DIV style="width:200px;border:1px dashed red;Overflow:hidden; Text-overflow:ellipsis ">nobr> is like a line of text, very long, a row in the table does not show ./nobr>nobr> A is for example a line of text, very long, a row in the table does not appear ./nobr>nobr> 1 is like a line of text, very long, a row in the table does not appear ./nobr>nobr> F is for example a line of te
Article provides three kinds of articles on the title too long, control displayed as a method, the following three CSS Tutorial control ellipsis mode display (ie, FF) code, after two are compatible ie,firefox.
div{
The basic definition of width:200px;/* container * *
height:200px;
Background-color: #eee;
}
/* IE under the style * *
P span{
Display:block;
width:200px;/* to the width of
In a line of text beyond the ellipsis display we often use the following methodsDisplay:block;width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;But when two lines and above are required, we need to change another method, the code is as followsDisplay:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;At this point the width of the parent is determined, if the requirement to display 3 lines beyond the
1.text-overflow:ellipsis implementationOverflow:hidden;text-overflow:ellipsis;//clip|ellipsiswhite-space:nowrap;2.-webkit-line-clampWidth:200px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient : Vertical;border:solid 1px black;3. Use the Include ellipsis (...) The implementation of elemental simulation. demo { height:200px; width:200px; position:relative; Line-height:1.4em; Height:4.2em;
the list is none, you can remove the dots or squares before each column.) )2) Set the float of UL and Li : left; (left float, i.e. each element is arranged from left to right)code example:. Tableclass ul{ float: left; height:50px; left:30px; line-height:50px; Position:absolute; List-style-type:none;}. Tableclass ul li{ float: left; width:100px; }3 div content too much, we sometimes need to be out of the section omitted, also very simple1) Set the div's white-space:nowra
CSS Chinese-English line wrapping1 Word-break:break-all; only works on English, with letters as the basis for line change 2 Word-wrap:break-word; only works on English, with words as the basis for line change 3 White-space:pre-wrap; only works on Chinese, Force line break 4 white-space:nowrap; Force no line break, all work 5 white-space:nowrap; overflow:hidden; text-overflow:ellipsis; not wrapped, partially hidden and appearing as ellipsesCSS
Today to do something, encountered this problem, Baidu after summing up the results.
First, you need to know the three properties of CSS.
Overflow:hidden; Out-of-text hiding
Text-overflow:ellipsis; Overflow with ellipsis display
White-space:nowrap; Overflow does not break line
These three are the basic properties of CSS and need to be remembered.
But the third a
to breathe air that has not been over-rendered by car exhaust? Want to make a breakfast for your lover? You have to get up early! You didn't finish it last night? How many pages is the word? Catch a plane and catch a train? You have to get up early! You don't want to go to work and get up early, don't you?P> P>Everyone is welcome to the early bird with the worm-21 days early plan. Set off, in the process of bathing the morning light, we wish everyone to start a good day! P> spanclass=
1. Single-line text overflow display ellipsis we can just use text-overflow:ellipsis.Implementation method:style>. Div_text{width:300px;padding:10px;Border:1px solid #001F33;Overflow:Hidden;Text-overflow:ellipsis;White-space:nowrap;}style>Divclass= "Div_text">single-line text overflow displays ellipses,Single-line text overflow display ellipsisDiv>Effect2. Multiple lines of text overflow, we can use WebKit CSS
The use of CSS in modern browsers can achieve text overflow, using text-overflow:ellipsis, in some scenarios, there is no effect, this time you need to check whether the application of the scene is a block element, whether there is a definite width.If the inline element is used, display is set to Inline-block;The following is a more accurate use of the CSS wrapping text overflow display
CSS settings text overflow does not show or display ellipses, only a certain length of text, IE9 just set
The code is as follows
Copy Code
Div{white-space:nowrap;text-overflow:none;}
Or
The code is as follows
Copy Code
Div{white-space:nowrap;text-overflow:ellipsis;}
, you need to increase the width setting in ie6,ie7 to take effect
The code is as follows
Cop
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.