Skip to content

Files

Latest commit

35830e6 · Aug 24, 2024

History

History

18-images-in-css

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 24, 2024

Images

  • You can read the img spec in HTML spec.
    • Categories:
      • Flow content.
      • Phrasing content.
      • Embedded content,
      • Form-associated element.
      • If the element has a usemap attribute: Interactive content.
      • Palpable content.
    • Contexts in which this element can be used:
      • Where embedded content is expected.
      • As a child of a picture element, after all source elements.
    • Content model: Nothing.
    • It represents an image.
    • Common attributes:
      • src: Address of the resource.
      • alt: Replacement text for use when images are not available. This is a must and behaves as if I wanna replace the image with a text.
  • In CSS images are replaced elements. Simply put they are elements that are outside of the CSS formatting model scope.
  • Images have natural dimensions; it is when we ain't specifying neither width or height.
    • If you specify only one of them (width or height) then it will keep the ratio in a way that your image won't loss its original shape.