newcoder1010 Posted August 28, 2015 Share Posted August 28, 2015 <label for=ʺedit-submitted-eventinformation-how-longʺ>How long <span class=ʺform-requiredʺ title=ʺThis field is required.ʺ>*</span></label> Hello, I have the code which has no ID. For some reason, I can not give ID using the tool. Can I still css the label using the for? If yes, can you please help? Thanks. Link to comment Share on other sites More sharing options...
Ingolme Posted August 28, 2015 Share Posted August 28, 2015 You can select an element by its attribute using the square bracket selector as in this example: label[for=edit-submitted-eventinformation-how-long] { color: red;} What "tool" are you using to write your HTML? Your environment should give you full control of the HTML you're writing. Link to comment Share on other sites More sharing options...
davej Posted August 28, 2015 Share Posted August 28, 2015 You don't need "for" attribute in a label if the label wraps the target. http://www.w3schools.com/tags/tag_label.asp I don't really understand your approach. You seem to be adding classes without regard to what is actually necessary for styling. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now