If I have the following:
<label for="deletetxt">Delete This Text</label>
What is the ‘for’ attribute here? Is that the id?
Assuming that I cannot set a class for the label element to style the label element, how do i set css for this element?
Two question, two answers:
What is the ‘for’ attribute here?
It’s here to tell the ID of the
<input>element that label refers to. Some browsers will use it to set focus on that<input>element when user clicks on that<LABEL>how do i set css for this element?
A. If you want to CSS all label elements :
B. If you want to label that element, just use IDs or classnames as you usually do.