Question:
CSS only select numbers?
FbRf
2010-10-03 11:03:21 UTC
i have a form submit button that has text and a number. i want the text to be in black, but i want the number to be in red. how do i do this? here is my css

input.mainBtn {
color:#000000;
font:Tahoma;
font-size:12px;
background-color:#ffdc7c;
border:0px;
text-align: center;
height:25px;
margin:0px;
padding:0px;
}
Three answers:
2010-10-03 15:32:57 UTC
Easiest way is to use an image submit button. Then you can use a graphics editor and make the image using all that CSS you have for the background, border, font family/size/color, etc.. Then all you'll have left in the CSS is the width/height. See...



Input Box with Background Image: http://paynelessdesigns.com/dsns/dsn_buttoncodes.shtml



Although that's for an input tag, you can do something similar with your submit button.



Ron
2010-10-03 18:23:50 UTC
All the text of the input element calling this style is going to be rendered the same color. You can't split the style in the way you describe.



You would need to use an image button to accomplish what you are after.
Nik
2010-10-03 19:50:40 UTC
CSS can only style not read input based on Number you will need JavaScript to accomplish this or a higher language.



CSS just see's text. As for this you will need an if statment



if (element == number ) then

{



}

else

{



}



etc css doesn't do this.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...