Inline | Block

aka:display property

  • Inline elements only occupy the width as much as their document content exists. Example: span, a, dt, dl, dd, tfoot
  • Block elements occupy 100% of the width by default. Example: div, p
  • Sauce



    ID | Classes


  • id attribute is used to uniquely identify an element
    Identified using "#" as a CSS selector
  • Classes attribute is used to group a certain element to that specific class
    Identified using "."as a CSS selector
  • Both of these attributes can have Multiplevalues
    Modern browsers can render a html that has same id for two different elements ,
    but its not a convention and some browsers even today might not support it
    NOTE: Generally all tags could be called as elements

    Next