BASIC TERMINOLOGY OF HTML AND CSS
THE THREE LANGUAGES OF THE FRONT-END
WHAT IS HTML?
HOT SALEπ©
πHyperText Markup Language.
π HTML is a markup language that web developers use to structure and
describe the content of a webpage (not a programming language).
π HTML consists of elements that describe different types of content:
paragraphs, links, headings, images, videos, etc.
π Web browsers understand HTML and render HTML code as websites.
ANATOMY OF AN HTML ELEMENT
πCascading Style Sheets
π CSS describes the visual style and presentation of the content
written in HTML
πCSS consists of countless properties that developers use to format
the content: properties about font, text, spacing, layout, etc.
HOW WE SELECT AND STYLE ELEMENTS
A CSS RULE
CONFLICTING SELECTORS AND DECLARATIONS
RESOLVING CONFLICTING DECLARATIONS
πContent: Text, images, etc.
π Border: A line around the element,
still inside of the element
π Padding: Invisible space around the
content, inside of the element
π Margin: Space outside of the
element, between elements
π Fill area: Area that gets filled with
background color or background
images
ANALOGY FOR THE CSS BOX MODEL
ELEMENT HEIGHT AND WIDTH CALCULATION
Final element width = left border + left padding +
width + right padding + right border
Final element height = top border + top padding
+ height + bottom padding + bottom border
π We can specify all these values using CSS properties
π This is the default behavior, but we can change it
BLOCK-LEVEL ELEMENTS
π Elements are formatted visually as blocks
π Elements occupy 100% of the parent elementβs width,
no matter the content
π Elements are stacked vertically by default, one
after another
π The box model applies as shown earlier
INLINE ELEMENTS
π Occupies only the space necessary for its content
π Causes no line-breaks after or before the element
π Box model applies differently: heights and
widths do not apply
πPaddings and margins are applied only
horizontally (left and right)
Comments
Post a Comment