HTML and CSS functions

s

Display property

Each element is a rectangular box. display determines how that rectangular box behaves.

Property Values

inline : Element stays in line with the surrounding text

  • You cannot set the height and width of it
  • You cannot set the vertical margin
  • You can set the horizontal margin
  • You can set the horizontal padding
  • Vertical padding will happen, but it will be ignored by other elements

Basically no height, width and vertical stuff.

block : Element sits on its own line

  • You can do everything on a block element

inline-block : Element stays in line with the surrounding text, but the border closes around tight

  • The element stays inline, but you can use all of the properties of a block.

none : Element does not display and does not leave a space

  • The element just disappears
  • This is different from visibility: hidden
    • Which simplys hides the element. But the element still ocupies that same space.

Home

Fonts

Units

Javascript

HTML Attributes