Underlined caption for enyo button

115 Views Asked by At

I want to give a caption like this to Enyo button. www.google.com should be underlined. How to give a combination of normal and underlined text as enyo button’s caption? Please help.

kind: "Button",
caption: "Go to www.google.com",
onclick: "btnGoTo",
3

There are 3 best solutions below

1
Webby Vanderhack On

It looks like you are using Enyo 1? It's been a long time, but the easiest way would be to look at the button's caption element in web inspector and see what classes it has and then add that class in your app's CSS with:

text-decoration: underline;

0
Pre101 On

Why not use:

{tag: "a", attributes: { href: "http://www.google.com"; }, content: "Go to www.google.com" }

See: http://forums.enyojs.com/discussion/421/anchor-tag

0
user758127 On

No reason your Button kind can't contain components. Apply styling to the component you'd like to underline.

enyo.kind({
  name: "myButton",
  kind:"Button",
  components: [
    {tag: "span", content: "Go to ", allowHtml: true},
    {tag: "span", content: "google.com", style:"text-decoration:underline"}
  ]
});