How to apply CSS styles only to some HTML elements in the form?

  • Profile Image
    Asked on April 01, 2016 at 01:06 PM
    Also, in the example from above, if I edit the CSS code, does that apply to ALL form labels? What if I have some that I want to show?
  • Profile Image
    Answered on April 01, 2016 at 01:15 PM

    Yes, the code provided by Beril above will affect all the labels in your form, if you want to affect only some fields then you will need to get the ID of that field and then apply the CSS code, to get the ID of the label that you want to affect you can only need to click on the right button of your mouse and then click on inspect, this over the label that you want to hide.

    The developers tool will be displayed, you only need to copy the value in the id attribute in the label. 

    Then you will be able to hide only the labels that you want, below is a sample code that you would need to use in order to hide more than one label:

    #label_1, #label_2, #label_3{

     display: none;


    This will help you to achieve what you want, this guide will help you to inject the code in your form: