Styling p:link to look like a Button ?

Locked
paulkeogh
Posts: 45
Joined: 04 Apr 2013, 23:00
Location: Dublin, Ireland
Contact:

09 Nov 2015, 18:19

Hi,

Any suggestions on how I can style a p:link to look like a button ?

I have tried;

Code: Select all

	<p:link value="View All" outcome="search"
		icon="fa fa-bars"
		styleClass="OrangeButton RaisedButton" />
but its not quite what I want.

Thanks,
Primefaces 6.2 Atmosphere 2.5
Red Hat Developer Studio 12.9 GA
Wildfly 14
Linux RHEL 7/CentOS 7

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

09 Nov 2015, 23:53

Please try with this css;

Code: Select all

/* CSS */
<style type="text/css"> 
    .MyLink.ui-link {
        color: #ffffff !important;
        display: inline-block;
        width: 162px;
        border-radius: 2px;
        font-size: 14px !important;
        font-weight: normal;
        padding: 10px 18px !important;
        line-height:normal;
        font-family: "robotoregular"; 
    }
    .MyLink.RaisedButton:hover {
       box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    }
    .MyLink.OrangeButton:hover {
       background-color: #fca537 !important;
    }
    .MyLink.fa::before{
        display: inline-block;
        margin-right: 32%;  /* you can change this value */
        font-family: "FontAwesome";
    }
    
    .ui-fluid .MyLink.ui-link {
        box-sizing: border-box;
        width: 100%;
    }
    .ui-fluid .MyLink.fa::before{
        margin-right: 44%; /* you can change this value */
    }
</style>

/* XHTML */
<p:link value="View All" styleClass="OrangeButton RaisedButton MyLink fa fa-bars">
I think you can change the value of CSS feature according to the needs.

Screenshot;
Image

paulkeogh
Posts: 45
Joined: 04 Apr 2013, 23:00
Location: Dublin, Ireland
Contact:

10 Nov 2015, 18:22

That works well, thanks !
Primefaces 6.2 Atmosphere 2.5
Red Hat Developer Studio 12.9 GA
Wildfly 14
Linux RHEL 7/CentOS 7

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

10 Nov 2015, 22:04

Glad to hear, thanks ;)

Locked

Return to “Modena”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests