Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a text only button?

Tags:

html

css

button

How can I create a button that only shows the text. Similar to an hyperlink but it has to keep the <button> properties.

like image 499
Vahan Avatar asked May 05 '11 17:05

Vahan


People also ask

How do you make a button look like text?

To create text buttons first, we create simple buttons in HTML using a button tag. After creating the button we apply CSS and change its properties to make it look like a text button. To make it look like a text button we remove its default border and background.

How do you text a button?

A text button is a label child displayed on a (zero elevation) Material widget. The label's Text and Icon widgets are displayed in the style's ButtonStyle. foregroundColor. The button reacts to touches by filling with the style's ButtonStyle.

Can you have a button without a form?

A button element is valid anywhere in the document body where text-level markup may appear. Such an element need not have any relationship to a form element.


1 Answers

Assuming you're starting with a button element:

<button class="astext">hello, world</button>

All you have to do is take away all of the default CSS styling:

.astext {
    background:none;
    border:none;
    margin:0;
    padding:0;
    cursor: pointer;
}

Of course, there's no way to tell that the resulting text is actually a button. I suppose you could throw in a cursor:pointer or some :hover rules.

Maybe you're making an easter egg, maybe you don't want people to know it can be clicked.

like image 81
sdleihssirhc Avatar answered Sep 17 '22 22:09

sdleihssirhc