style - CSS Styles
Specifies font styles for a control.
Category
stylingSyntax
style="name:value;..."
Where name
and value
are
joined by a colon to define one style element. Multiple style elements
are separated by semicolons. The following table specifies the allowed
names and values.Name | Value | Examples |
---|---|---|
height |
|
|
width |
|
|
font-family | The name of a font, a comma, and the keyword serif or sans-serif .
Either part is optional in which case the comma is omitted. |
|
font-size | An integer followed by pt for points. |
|
color | The keyword rgb followed by integer values
for red, green, and blue in parentheses separated by commas. |
|
font-weight | The keyword bold . Otherwise the weight is
normal. |
|
font-style | The keyword italic . Otherwise the style
is plain. |
|
text-decoration | The keyword underline , line-through ,
or both separated by a space. |
|
text-align | The keyword left , center , right ,
or justify . |
|
Usage
In Design mode, for height and width, click the top tab under Properties and look for Height and Width followed by Units, or click All Properties and look for style under styling. If you compute the value, return a number for height and width, and returnpx
, em
, %
,
or null
for the unit. You can also change the height
and width by grabbing and dragging in the editor.For the other style specifications, click Font under Properties or click All Properties and look for style under styling. These values are static.
Examples
This Edit Box control specifies a static height and width.<xp:inputText id="inputText1" value="#{document1.subject}"></xp:inputText style="height:3.75em;width:55.583332em">
This Edit Box control returns computed values for height and width (but static values for the unit).
<xp:inputText id="inputText1" value="#{document1.subject}">
<xp:this.style><![CDATA[height:#{javascript:if (document1.isEditable()) {
return 38 }}px;
width:#{javascript:if (document1.isEditable()) {
return 252}}px]]></xp:this.style>
</xp:inputText>