Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6989389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:12:20+00:00 2026-05-27T19:12:20+00:00

I have a <p:commandLink> wherein I want to show a picture as CSS backgound

  • 0

I have a <p:commandLink> wherein I want to show a picture as CSS backgound image:

.button{
    background-image: url(http://www.lefinnois.net/aqua/aqua1.jpg);
    background-size: 50px;    
}
<p:commandLink update="media" value="Kaydet"
    action="#{productView.save}" styleClass="button">
</p:commandLink>

But I need the command link to have the same width and height as the background image. If I add the following property to the CSS

background-size: 50px;

then I can see a small portion of the image. If I don’t add this, I cannot see the image.

If I try to add this to the CSS

width: 100px;
height: 50px;

then nothing changes.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:12:21+00:00Added an answer on May 27, 2026 at 7:12 pm

    Tag <a/> generated by p:commandLink is an inline html element and as such has cannot have its size set. You can override it by setting display css attribute to inline-block – or use p:commandButton instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a p:commandLink with .button{ background-image: url(http://www.lefinnois.net/aqua/aqua1.jpg); display:inline-block; width:150; height:50; } <p:commandLink update=media
i have used rich:editor to show file content.If i use h:commandlink for display the
I have problem with f:ajax tag. I want to show and hide some data
I want to have a component that looks like a button, but instead of
i have a commandLink that has a graphicImage inside and i want to change
I have the code bellow: <c:set var=show value=#{cartBean.itemsAdded} /> <c:if test=${show}> <h:form id=test1> <h:commandLink
The commandlink link2 does not have work after an ajax call is made to
I have pop-up with h:selectOneMenu . This pop-up will be displayed on a4j:commandLink click.
I have such structure in my jsp: <h:commandLink action=#{docbean.save}> <a4j:actionParam name=somename value=bill_all assignTo=#{billdoc.billType}/> <a4j:actionParam
I have the following line in a JSF page: <h:commandLink action=#{myBean.test} value=Wizard Step></h:commandLink> I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.