Title: How do turn html href= button using css?
Last modified: January 29, 2019

---

# How do turn html href= button using css?

 *  Resolved [adsler26](https://wordpress.org/support/users/adsler26/)
 * (@adsler26)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-do-turn-html-href-button-using-css/)
 * Hi,
 * I have a hyperlink “Contact”. The code is in html (href=…) and i want to turn
   this into a button using css.
 * So i need to target that specific element and style it using css.
 * I tried the ‘a’ selector, and it just turned every link on the site into button.
 * Does anyone know?
 * Thanks,
 * Nico
    Adsler.co.uk.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhow-do-turn-html-href-button-using-css%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 12 replies - 1 through 12 (of 12 total)

 *  [Maurice](https://wordpress.org/support/users/mohaftig/)
 * (@mohaftig)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-do-turn-html-href-button-using-css/#post-11145832)
 * I would recommend to assign a class to that link.
 * [https://www.w3schools.com/css/css_syntax.asp](https://www.w3schools.com/css/css_syntax.asp)
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-do-turn-html-href-button-using-css/#post-11146071)
 * Where is the contact link you refer to?
 *  Thread Starter [adsler26](https://wordpress.org/support/users/adsler26/)
 * (@adsler26)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-do-turn-html-href-button-using-css/#post-11146189)
 * Hi,
 * Thanks for reply.
 * You’d need to create an account to see it.
 * Once there, clicking on an ad will get you to contact details, under contact 
   details there is a ‘contact… ‘ hyperlink.
 *  Thread Starter [adsler26](https://wordpress.org/support/users/adsler26/)
 * (@adsler26)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-do-turn-html-href-button-using-css/#post-11146250)
 * The div is:
 * ‘showhomepage’ so i tried
 * .showhomepage a {
    display: inline-block; background-color: #000000; }
 * didn’t work
 * My css box keeps automatically deleting what i put in it…
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-do-turn-html-href-button-using-css/#post-11146293)
 * What is the full HTML when you say “the div is”?
 *  Thread Starter [adsler26](https://wordpress.org/support/users/adsler26/)
 * (@adsler26)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-do-turn-html-href-button-using-css/#post-11146323)
 * <div class=”showawpcpadpage”>
    <div class=”awpcp-ad-primary-image”>[⌊Thumbnail for the listing's main image⌉](https://i0.wp.com/adsler.co.uk/wp-content/uploads/awpcp/images/19808423-847878c5-large.jpg)
   [Click to enlarge image.](http://adsler.co.uk/wp-content/uploads/awpcp/images/19808423-847878c5-large.jpg)
   </div> <div class=”awpcp-subtitle”>Contact Information</div> [Contact Nac](http://adsler.co.uk/wp-user-test-dashboard-2/awpcp-reply-to-ad/10/old-goriot/)
 *  Thread Starter [adsler26](https://wordpress.org/support/users/adsler26/)
 * (@adsler26)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-do-turn-html-href-button-using-css/#post-11146330)
 * So div is awpcp-subtitle?
 *  Thread Starter [adsler26](https://wordpress.org/support/users/adsler26/)
 * (@adsler26)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-do-turn-html-href-button-using-css/#post-11146334)
 * if i do
 * .awpcp-subtitle { etc?
 *  Thread Starter [adsler26](https://wordpress.org/support/users/adsler26/)
 * (@adsler26)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-do-turn-html-href-button-using-css/#post-11146336)
 * Or
 * .awpcp-subtitle a. {
    etc: etc; ?
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-do-turn-html-href-button-using-css/#post-11147586)
 * Can you post that again but make sure you use the “code” button – so that your
   code is surrounded in the backtick character.
    Like so:
 *     ```
       Hello World
       ```
   
 *  Thread Starter [adsler26](https://wordpress.org/support/users/adsler26/)
 * (@adsler26)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-do-turn-html-href-button-using-css/#post-11149222)
 * Hi,
 * So. This should work. Did for me.
 * a[href=”google.com”] {
    background: green; color: white; padding: 5px;
 * }
 * Thanks
    -  This reply was modified 7 years, 4 months ago by [adsler26](https://wordpress.org/support/users/adsler26/).
 *  Thread Starter [adsler26](https://wordpress.org/support/users/adsler26/)
 * (@adsler26)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/how-do-turn-html-href-button-using-css/#post-11150600)
 * This is resolved for me. Thanks

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘How do turn html href= button using css?’ is closed to new replies.

## Tags

 * [button](https://wordpress.org/support/topic-tag/button/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [href](https://wordpress.org/support/topic-tag/href/)
 * [html](https://wordpress.org/support/topic-tag/html/)
 * [hyperlink](https://wordpress.org/support/topic-tag/hyperlink/)
 * [selector](https://wordpress.org/support/topic-tag/selector/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 12 replies
 * 3 participants
 * Last reply from: [adsler26](https://wordpress.org/support/users/adsler26/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/how-do-turn-html-href-button-using-css/#post-11150600)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
