This is a migrated thread and some comments may be shown as answers.

How to centre Title-Text?

2 Answers 249 Views
TileList
This is a migrated thread and some comments may be shown as answers.
Al
Top achievements
Rank 1
Iron
Iron
Iron
Al asked on 28 Jun 2016, 10:58 AM

Hi,

I have a RadIconTile with Shape=Wide - how do you centre the title text to the vertical middle of the box?

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 28 Jun 2016, 11:18 AM

Hello Al,

You can inspect the rendered HTML in the browser dev toolbar and override the built-in CSS and use any generic approach for centering elements vertically.

Here is a basic example:

<telerik:RadTextTile runat="server" ID="RTT1" Shape="Wide" CssClass="centeredTitle" RenderMode="Lightweight">
    <Title Text="lorem ipsum"></Title>
</telerik:RadTextTile>
.centeredTitle.RadTile h6.rtileTitle
{
    /*standard approach for centering elements with position: absolute*/
    top: 50%;
    /*inspect the DOM element and see the built-in line-height value to get the numbers below*/
    margin-top: -0.46em; /*for Lightweight render mode*/
    margin-top: -7.5px; /*for Classic render mode*/
}


Regards,

Marin Bratanov
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Al
Top achievements
Rank 1
Iron
Iron
Iron
answered on 28 Jun 2016, 11:33 AM

Thanks Marin,

I actually meant left-right centering so I used this with Classic rendering:

.centeredTitle.RadTile h6.rtileTitle
{
margin-left: 35px;
text-align:center;
}

 

 

Tags
TileList
Asked by
Al
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Marin Bratanov
Telerik team
Al
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or