0
what is the purpose of <p>,<span>
i can't identify difference
3 Réponses
+ 4
p is a block element and span is an inline element..
in p tag if you write something it will be displayed with a line break.. but when you write something in span tag.. there won't be any line break otter the texts..
and since p tag is an block level element it can be nested with one or more elements.. but span tag can not nest elements. but if try doing it then the p tag will override the span tag.. that is the p tag nested in span tag will not behave as inline it will always be block element
+ 4
see span tag used in p tag..
https://code.sololearn.com/WCjHzWAz5ODH/?ref=app
+ 1
so thank you
i understand clearly