0

Let's say you have a form input button that you want to style with CSS, but you also want to use "::before" to append text before the styling. How would you do that? Is that even possible?

input[type=submit]::before {} (this doesn't work)

Is editing "value='blahblahbuttontext'" in the form the only way to achieve this?

Thanks,

-- MP

1 Answers1

0

No, pseudo elements don't work on inputs. You can achieve such an effect using javascript, or you can use pure CSS but you will need to replace the input with a button.

[type="submit"]:before{
  content: "blahblah";
}
<button type="submit">buttontext</button>
Chad
  • 1,531
  • 3
  • 20
  • 46
Heri Hehe Setiawan
  • 1,535
  • 1
  • 12
  • 19
  • Wow, fast reply. Thanks! And sorry for the duplicate question (I'm new here). I didn't turn up anything in my initial search for an answer. I guess my search criteria was way off. – Mr. Pixels Feb 28 '15 at 22:48