![]() ![]() To make the element block type, we use display: block and to make it inline-block type use display: inline-block. ![]() To change the default block type of an element, we use the display property. That is, to set the width or height of a span, we have to either make it a block or inline-block level element. Well, the only solution to this problem is changing the block type of the span tag. The reason why the width and height properties do not affect a span tag is that the span tag is an inline element and applying the width and height properties has no effect on such elements. But, you might have at least once faced a problem where you need to set the width and height of a span tag but it didn’t work. When building a website, we often need to set the width and height of elements to fit them in the layout. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |