Good Morning. I was writing a code and realized that I did not have to write the display property for the width property to work for inputs. On the other hand, I need to write a display property with value inline-block or block for the width property to work for labels. Why does this happen if both are inline by default (according to MDN)?. The section of CSS I wrote, follows below:
label { 02 03 display: inline-block; 04 width: 50px; 05 margin-top: 10px; 06 } 07 08 #name, #email { 09 10 width: 280px; 11 border-top: none; 12 border-right: none; 13 border-bottom: 1px dotted #DCDCDC; 14 border-left: none; 15 padding: 5px; 16 }
#name and #email are ids for inputs in the html.
If necessary, I will post the entire code.
Thank you for your help.