Grouping Elements horizontally using the Span Tag

Span Tag is an HTML Tag used to group Inline Elements. An Inline Element is an element which occupies only the space between the Opening and Closing Tag. A Span Tag by itself is an Inline Element. For Example

Screenshot (88).png

In the diagram above, the HTML code is on the First box from the top left corner, followed by CSS, Result and Java Script in the clockwise direction.

In the Sentence “The Grass is Green”, the span tag is applied to the word Green. And you would notice that the color is only applied to the word Green.

Span Tags take minimal amount of space. With this analogy, if you want to group two Inline elements horizontally always use a Span Tag to group them.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s