mjsulliv Posted December 6, 2010 Share Posted December 6, 2010 I'm confused about some CSS syntax. I thought you could "classify" a tag w/o using the "class" attribute in the HTML by specifying a type of tag in the CSS.Example:CSS: input.checkbox { margin-left: 50px;} Then whenever a checkbox was used in the HTML it would have a 50px margin on the left; even w/o having class=checkbox in the "input" html. Link to comment Share on other sites More sharing options...
thescientist Posted December 6, 2010 Share Posted December 6, 2010 yes, that is the method of using selectors. what does the form look like? Link to comment Share on other sites More sharing options...
ShadowMage Posted December 6, 2010 Share Posted December 6, 2010 Actually you need an attribute selector:input[type=checkbox]EDIT: Whoops, left a space in there... Link to comment Share on other sites More sharing options...
jeffman Posted December 6, 2010 Share Posted December 6, 2010 I think you meaninput[type=checkbox] Link to comment Share on other sites More sharing options...
thescientist Posted December 6, 2010 Share Posted December 6, 2010 oh yeah, i keep forgetting from elements always get tricky. value instead of innerHTML, fancy selectors. Link to comment Share on other sites More sharing options...
mjsulliv Posted December 6, 2010 Author Share Posted December 6, 2010 Perfect. Thank you all!!! Link to comment Share on other sites More sharing options...
Fmdpa Posted December 6, 2010 Share Posted December 6, 2010 Are you sure you need the quotes? I use attribute selectors successfully all the time without quotes around the attribute value. input[type=checkbox] Link to comment Share on other sites More sharing options...
jeffman Posted December 7, 2010 Share Posted December 7, 2010 I'm pretty sure they are optional. The quoted style makes sense when I look at it, so that's what I use. YMMV Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.