문제

I have * in all pages with forms. Can I change * to red color for all required fields through out my site with out wrapping it in div or some other wrapper?

도움이 되었습니까?

해결책

hope it will help you, try with jquery, it will all " * " and chages the color to red

   $("body").html($("body").html().replace(/[*]/g,'<span style="color:red">*</span>'));

demo

다른 팁

Assume your HTML looks like this:

 <input type="text" name="myName" /><span>*</span>

Then your CSS might look like this

 input + span{
     color: #ff0000;
 }

That might get you close to what you want . . .

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