Question
Suncorp
AU
Last activity: 13 Aug 2018 2:14 EDT
Apply text-align:center to a link
Hi Everyone,
My requirement is to align a link to the center of a layout.
I tried this with skin and adding text-align:center to link, and also to layouts with no luck.
the only way I could achieve this was through by adding an inline style, which Pega does not reccommend.
If anyone has faced this kind of scenario, can you please share how you were able to get it done.
Thanks
-
Likes (1)
Bharath Bukkaraju -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
IN
Hello Ishan,
Thanks for posting query in PSC.
If the inline style works for you then create a custom css style sheet and apply the style property to specific element using the css selector.
Note: Include the style sheet in additional style sheet of application skin.
Regards,
Durga
EPAM Systems, Inc.
ES
text-align:center : It sets the text alignment for different <div> elements not the "control" to a centre of the dynamic layout.
Could you please share the screen-shot to understand, what exactly you want?
-
Brodie Green Mahesh Kharde Zach Karpinski
Accepted Solution
Pegasystems Inc.
IN
Hello Ishan,
Thanks for posting query in PSC.
If the inline style works for you then create a custom css style sheet and apply the style property to specific element using the css selector.
Note: Include the style sheet in additional style sheet of application skin.
Regards,
Durga
Suncorp
AU
Sorry for the late reply. It worked, Thank you. Had to add the css into the div element through custom style sheet.
Pegasystems Inc.
US
Hi,
Can you try using margin/padding attribute to align the link to the center? Also, did you try using different layout formats? Attaching screenshots will really help us.
Regards,
Rachit
Suncorp
AU
Hi All, Thanks for your help.
As you have suggested I tried adding an additional style sheet, and still it doesn't seem to work.
Below is a screenshot of how the inline style has been applied in HTML code when the style was added as inline style.
Below is the css I applied for the control.
a.text_align_center_link{
text-align:center;
}
Below is a screenshot that the stylesheet is included in the backend.
Still it doesn't seem to work.
Hi All, Thanks for your help.
As you have suggested I tried adding an additional style sheet, and still it doesn't seem to work.
Below is a screenshot of how the inline style has been applied in HTML code when the style was added as inline style.
Below is the css I applied for the control.
a.text_align_center_link{
text-align:center;
}
Below is a screenshot that the stylesheet is included in the backend.
Still it doesn't seem to work.
Since when the inline style worked by adding it in the "div", I tried to identify a div element that I can apply the style to, but couldn't find such element.
Can you please help on this, whether there is a workaround or an element that I can apply the style to.
Thanks
Updated: 28 Jun 2018 4:22 EDT
Pegasystems Inc.
US
Can you try the below css.
a.text_align_center_link{
text-align:center;
margin-left: 10px;
}