CSS: Accessing INPUT controls

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

CSS: Accessing INPUT controls

Post by raghavan20 »

If you run the code, you can see that anything I tried to access by input.controltype does not work.
anyone can tell me why???
suggestions are welcome.

Code: Select all

<style type = 'text/css'>
	input.submit{
		border:1px solid #000000; background-color:#0000FF; color:#FFFFFF;
	}
	
	INPUT.SUBMIT{
		border:1px solid #000000; background-color:#0000FF; color:#FFFFFF;
	}

	.button{
		border:1px solid #000000; background-color:#0000FF; color:#FFFFFF;
	}

	INPUT.BUTTON{
		border:1px solid #000000; background-color:#0000FF; color:#FFFFFF;
	}



	INPUT.TEXT{
 	  font-family:TrebuchetMS;
	  font-size:9pt;
	  font-weight:bold;
	  background-color:336699;
	  border-color:336699;
	  border-style:inset;
	  border-width:2px;
	  color:FFFFFF;
	}

</style>
<body>
<form>
<input type = 'submit' value ='submit' />
<input type = 'submit' value ='submit' class = 'button' />
<input type = 'button' value ='Click me'/>
<input type = 'text' value ='Click me'/>
</form>
</body>
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

because CSS only has input element and does not recognise the type="xxx" of input tag AFAIK. I too had this prob and workaround for me was to use classes as you may haev done.

HIH
Post Reply