Nov 10, 2018, 5:18 PM
Vertical Align Label Text to Background of Label Control
Hello,
I am trying to make the background and text of the label control align vertically but it seems that the text is only half contained by the background container. A picture of the result and sample code is included below.
I am trying to make the background and text of the label control align vertically but it seems that the text is only half contained by the background container. A picture of the result and sample code is included below.
@section Content
{
@(
X.Viewport ( )
.ID
( nsMyIdentify.IdMapEnum.DesignerViewportForDesigner.ToString ( ) )
.Border ( false )
.Layout
( Ext.Net.LayoutType.Border )
.Flex ( 1 )
.Margin ( 0 )
.Items
(
X.Panel()
.Layout(Ext.Net.LayoutType.Absolute)
.Width (1600)
.Height(900)
.Items
(
X.DisplayField()
.ID("MyDisplayField")
.X(100)
.Y(100)
.Text("DisplayField")
.Height(100)
.WidthSpec("auto")
.StyleSpec("background-color:yellow;")
.SetFieldStyle("font-family:Arial;font-size:100px;line-height:100px;width:auto;background-color:yellow;vertical-align:bottom;")
.FieldStyle ( "font-family:Arial;font-size:100px;line-height:100px;;width:auto;background-color:yellow;vertical-align:bottom" )
.Listeners
(
l=>l.AfterRender.Fn="OnAfterRender"
),
X.Label()
.ID("MyLabel")
.Height(100)
.WidthSpec( "auto")
// .HeightSpec ( "100px")
.X(500)
.Y(500)
.Text ("Label")
.StyleSpec ( "font-family:Arial;font-size:100px;background-color:lightblue;vertical-align:bottom;display:table-cell;" )
.ApplyStyles ( "font-family:Arial;font-size:100px;background-color:lightblue;vertical-align:bottom;display:table-cell;" )
)
)
)
}