Display property | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Display property

When i type Div { display: inline; } It doesnā€™t apply to the html. However when if i change it so the propertyā€™s applied to the p it works P { display: inline; } Can somebody explain why? I donā€™t want to have to type the class for every para that needs to be displayed as an inline element.

7th Aug 2018, 2:57 PM
Helen
Helen - avatar
4 Respostas
+ 2
for the div you should use inline-block
7th Aug 2018, 3:35 PM
TrueJu
TrueJu - avatar
+ 2
it is but a div has to have display:inline-block; while other elements can use inline and inline-block
7th Aug 2018, 3:39 PM
TrueJu
TrueJu - avatar
+ 1
so the display property is not applicable for div?
7th Aug 2018, 3:38 PM
Helen
Helen - avatar
+ 1
oh i see. thank you so much šŸ‘šŸ½
7th Aug 2018, 4:09 PM
Helen
Helen - avatar