...

View Full Version : CSS Buttons withint a div style



fogetaboutit
05-09-2011, 03:01 PM
How do I control the buttons? When I make changes to the input tag it effects the buttons:
style sheet code


#search input, select{
height:20px;
margin-left: 15px;
background: #ECF9E4;
color: #000000;
font: 14px Georgia, "Times New Roman", Times, serif;
}


HTML code


<div style=search>
<tr>
<td colspan="3" align="right">
<input type="reset" value="Cancel" onclick="javascript:refresh();" ID="button1" name="button1" />
<input type="button" value="Register" onclick="javascript:DoSubmit(1);" ID="Button2" name="Button2" />
</td>
</tr>
</div>

DanInMa
05-09-2011, 03:13 PM
#search input, select{}

this selector basically translates to "apply these styles to ANY input elements in the div with an id of "search"

this is a fairly specific selector so I would recommend you also use the button id to apply what style changes you are looking for like so



#button1{
new styles here
}


or if you want both buttons to use this style then:
#button1,#button2{
styles here
}


if the buttons are going to have the same look then you could just add a new class and assign that class to both buttons and add your style changes that way, but since #search input is somewhat specific, a class may not be good enough

fogetaboutit
05-09-2011, 03:25 PM
thanks for the reply. I did try and add the new class:
[code]
#button1,#button2{
styles here
}
[code]
and it had zero effect on the buttons.

abduraooft
05-09-2011, 03:29 PM
<input type="reset" value="Cancel" onclick="refresh();" id="button1" name="button1" />
<input type="button" value="Register" onclick="DoSubmit(1);" id="Button2" name="Button2" />
For the above two, you need

#Button1, #Button2{

}

DanInMa
05-09-2011, 03:46 PM
thanks for the reply. I did try and add the new class:
[code]
#button1,#button2{
styles here
}
[code]
and it had zero effect on the buttons.

well you have to add the style changes you want silly :). I'm guessing you don't know much about css ( nothing wrong with that we are all here to learn and grow) , so maybe you should be a little more specific. What changes would you like to apply to these 2 buttons?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum