aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/mozilla/tech/xul/attribute/crop/index.html
blob: 1ab3f592101622e38f09f93d0f298baca7423951 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
title: crop
slug: Mozilla/Tech/XUL/Attribute/crop
tags:
  - XUL Attributes
translation_of: Archive/Mozilla/XUL/Attribute/crop
---
<div class="noinclude">
 <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
<dl>
 <dt>
  <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code></dt>
 <dd>
  Type:
  <i>
   one of the values below</i>
 </dd>
 <dd>
  If the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the <code>crop</code> attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.</dd>
</dl>
<ul>
 <li><code>start</code>: The text will be cropped on its left side.</li>
 <li><code>end</code>: The text will be cropped on its right side.</li>
 <li><code>left</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its left side.</li>
 <li><code>right</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its right side.</li>
 <li><code>center</code>: The text will be cropped in the middle, showing both the start and end of the text normally.</li>
 <li><code>none</code>: The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.</li>
</ul>
<div class="noinclude">
 <dl>
  <dd>
   Depending on the platform and theme being used, some elements will have a set maximum width so they will be always appear cropped. If you wish to use the value <code>none</code> and the displayed text is larger than this maximum width, you may be able to use the max-width CSS property (or the maxwidth attribute) to override this size. For example, for a menuitem in a menu you can add the following CSS rule when you want to use the value <code>none</code>:</dd>
 </dl>
 <pre class="eval">menupopup &gt; menuitem, menupopup &gt; menu { max-width: none; }
</pre>
</div>
<p></p>