HTML - Span element


The span element is a generic wrapper for phrasing content that by itself does not represent anything.

Span doesn't have explicit attributes.


Span is then handy to use:


div elements are rendered as block boxes whereas span element are rendered as inline box.


  • The world word will then stay on the same line (ie in the p block element.
Hallo <span style="color:green">World</span>
  • Output:

Documentation / Reference

Discover More

CSS A carret/ is made in CSS with the help of the border corner. The following ingredients are needed: a block box with a height and width of null and transparent border The width of the border...
CSS - Block And Inline Layout (Block Formatting context)

CSS - Block And Inline Layout (Block Formatting context) CSS Block and inline layout is the first layout model of CSS. It's also known as: * block formatting * flow layout The component are laid...
CSS - Bottom Property

The bottom property is the offset from the bottom edge of the . It applies only if the box itself has a position value of: relative absolute or fixed staticleftnormal flow positioning model ...
CSS - Boxes (Box Model)

CSS The Box model means that each element is represented as a rectangular box. The layout phase of the browser rendering engine creates the box model as a tree of box and determines: the , the...
CSS - Inline Box

CSS This page is inline box in the block formatting layout context. Inline box can be generated: by default from an inline element or by setting the display property. Inline-level elements...
CSS - Left property explained as 1, 2, 3

The left property is an offset from the left edge of the containing block. This article shows you in two simple rules how to determine the containing block.
CSS - Position - Offset Properties (Left, Right, Top, Bottom)

The Offset CSS Properties of a box are top, left, right, bottom They are applied to the containing box in the following positioning model in order to position a box. relative absolute...
CSS - Top Property

The top property is a offset property that specifies how far is positioned the box from the top edge of its . It applies only if the box itself has a position value of: relative absolute or fixed...
CSS - Width property (of a box)

The width property specifies the width of boxes and it's calculation is defined by the box sizing property. HTMLCSS HTML width attributeHTMLimgiframe... If you want to set a width on a p element for...
HTML - (Flow|Body) Content

Most elements that are used in the body of documents and applications are categorized as flow content. Flow content consists of flow elements intermixed with normal character data. (ifbodhead...

Share this page:
Follow us:
Task Runner