mikeb
mikeb

Reputation: 727

Make an html button appear as text

<li id="item2"><button onclick="myFunction2()">About us </button></li>

Is there anyway that "About us" can appear as just text and not a button on the website?

Upvotes: 5

Views: 1329

Answers (4)

Rohit Azad Malik
Rohit Azad Malik

Reputation: 32172

As like this .

#item2>button{background:none;border:none;outline:none;cursor:pointer}
<li id="item2"><button onclick="myFunction2()">About us </button></li>

Upvotes: 3

Sachin Gadagi
Sachin Gadagi

Reputation: 749

This should do the work.

button,button:focus,button:active
{
    border:none;
    background:none;
    outline:none;

}

button,
button:focus,
button:active {
  border: none;
  background: none;
  outline: none;
}
<li id="item2">
  <button type="button" onclick="onButtonClick()">About us</button>
</li>

Upvotes: 0

Greenhorn
Greenhorn

Reputation: 590

I just changed the HTML element from <button> to <p> and it worked while looking same as a regular text.

<p onclick="myFunction2()">About us</p>

Upvotes: 0

Shrinivas Pai
Shrinivas Pai

Reputation: 7701

Add this

button {
background:none;
border:none;
margin:0;
padding:0;
}

button:focus{
outline: 0;
} 

Fiddle

Upvotes: -1

Related Questions