How can i apply css stylesheet to single specific element?

后端 未结 4 1575
情深已故
情深已故 2020-12-21 14:00

I am new to web development, I have tried css stylesheet with simple HTML element and it worked well, when i specified element name:

label {
    color: green         


        
4条回答
  •  猫巷女王i
    2020-12-21 14:51

    Use id of the element if you want to target a specific element. Example:

    #labelId{
        color: green;
    }
    
    
    

    Alternatively, you can also provide specific class name to the element. Example:

    .label-class{
        color: green;
    }
    
    
    

提交回复
热议问题