문제

It seems browsers dislike the use of :before and :after for submit buttons in particular, which I'm guessing has something to do with click jacking prevention. However, it basically ruins a specific style I'm trying to achieve, and my alternatives to replicate the effect are poor.

How can I produce an effect similar to :before and :after for submit buttons without using scripts? I am able to generate additional elements (via. server scripts) for each occurrence of a submit button, if need be. Ideally not wrapper elements, but I could make those work.

도움이 되었습니까?

해결책

Use a <button type="submit"> element so that you can add additional <span> elements within the button if you simply need more DOM nodes.

:before will also work on button elements.

다른 팁

You can use <span> or <div> elements.

Here are some examples of use with <span> on :

  • <input type="text"/>
  • <input type="submit"/>
  • <button type="button">
  • <button type="submit">

FIDDLE

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top