How can I create a button that only shows the text. Similar to an hyperlink but it has to keep the <button>
properties.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With