Key takeaways
- HTML gives the structure, CSS gives the look; the notes keep both side by side with small code examples.
- Flexbox is for one direction (a row or a column), grid is for rows and columns together; a comparison table shows when to use which.
- Add
box-sizing: border-boxand the viewport meta tag on every page; the notes explain why. - Write mobile-first CSS and use
min-widthmedia queries for bigger screens. - The last pages give 7 small projects, a table of common mistakes and 8 practice questions.
About these HTML CSS notes
This page offers Uncodemy's HTML and CSS notes as a free PDF. HTML (HyperText Markup Language) builds the structure of a web page, and CSS (Cascading Style Sheets) controls its colours, fonts, spacing and layout. The notes explain each idea in plain words, show a small code example you can type and run, and use tables and simple diagrams for things like the box model and the flexbox axes. They start from a blank index.html and end with full page layouts, so a beginner can follow them in order.
Please note: these are original Uncodemy learning notes, not official documentation. Browsers add new CSS features every year, so check MDN Web Docs when you need the full list of options for a property.
What's inside the HTML CSS notes
The PDF has 10 pages arranged in 11 numbered sections. Each section has short points, a table and at least one code example. Here is what each section covers.
1. Start with HTML and CSS
What HTML, CSS and JavaScript each do (with the skeleton, clothes and movement idea), a basic page skeleton with DOCTYPE, meta charset, the viewport tag and a linked style.css, and how to run it with VS Code and the Live Server extension.
2. HTML tags
Opening and closing tags, self-closing tags and attributes, then a table of everyday tags: headings, paragraph, link, image with alt text, lists, div and span, line break and bold or italic. It also explains block versus inline elements and shows a simple table.
3. Forms and semantic HTML
A sign-up form with labels linked by for and id, input types (text, email, password, number, checkbox, radio, date, file), select, textarea and useful attributes such as required and placeholder. A table explains the semantic tags header, nav, main, section, article, aside and footer, and why they help SEO and screen readers.
4. CSS basics
The structure of a CSS rule, the three ways to add CSS, and a selector table (element, class, id, group, descendant, child and hover). It covers specificity in one line (inline beats id, id beats class, class beats element) and the colour formats name, hex, RGB or RGBA and HSL.
5. The box model
Content, padding, border and margin with a labelled diagram, centring a box with margin: auto, the clockwise shorthand order and the box-sizing: border-box reset.
6. Display, position and units
Tables for display (block, inline, inline-block, none, flex, grid), position (static, relative, absolute, fixed, sticky) and units (px, %, em, rem, vw and vh), with a sticky navbar and a badge placed on a card.
7. Flexbox
Main axis and cross axis with a diagram, the container properties flex-direction, justify-content, align-items, flex-wrap and gap, the item properties flex, align-self and order, and examples to centre anything, build a navbar and wrap cards.
8. CSS grid
display: grid, the fr unit and repeat(), spanning columns, a property table, responsive cards with repeat(auto-fit, minmax(220px, 1fr)) and no media query, a full page layout with grid-template-areas, and a flexbox versus grid comparison table.
9. Responsive layouts
Mobile-first CSS with min-width media queries, common breakpoints for phone, tablet, laptop and large screen, max-width: 100% for images, a table that matches each layout need to flexbox or grid, and fluid font sizes with clamp().
10. Colours, fonts and effects
CSS variables, hover effects, transition and transform, box-shadow, gradients, border-radius, font properties, pseudo-classes such as :hover and :focus, and pseudo-elements ::before and ::after.
11. Projects and practice
Seven projects (portfolio page, responsive navbar, landing page, pricing cards, photo gallery, blog layout and sign-up form page) with the skills each one practises, a common mistakes table and 8 practice questions.
How to use these notes to learn HTML and CSS
HTML and CSS are learnt by typing, not by reading. Keep the PDF on one side and your editor on the other.
- Type every example yourself into a new file and open it in the browser; change one value at a time and watch what happens.
- Open DevTools (F12) and use the Elements panel to see the box model, padding and margin of any element.
- For flexbox and grid, make five coloured boxes and try every value of
justify-content,align-itemsandgrid-template-columns. - Rebuild the layout of a real website you like with only semantic tags, flexbox and grid.
A simple three-pass method works well. In the first pass, read one section and type its examples. In the second pass, close the notes and build a small page that uses that section, then compare with the notes and fix what is different. In the third pass, a day or two later, answer two practice questions from memory and build the related project from the last section.
Syntax to remember
- The page skeleton with
<meta name="viewport" content="width=device-width, initial-scale=1">in the head. - The reset
*, *::before, *::after { box-sizing: border-box; }. - Centre anything:
display: flex; justify-content: center; align-items: center;on the parent. - Responsive cards:
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));. - Shorthand order for margin and padding: top, right, bottom, left (clockwise).
- Specificity order: inline style, then id, then class, then element.
Common mistakes beginners make
- Leaving out the viewport meta tag, so the page looks tiny on phones.
- Forgetting alt text on images, which hurts accessibility and SEO.
- Using
divfor everything instead ofheader,nav,main,sectionandfooter. - Writing
justify-contenton the child instead of the flex parent. - Using fixed pixel widths that cause horizontal scrolling on small screens.
Interview focus: HTML and CSS topics asked most
Front-end and full stack fresher interviews usually start with HTML and CSS basics before moving to JavaScript. The notes' practice questions match these common areas.
- Block, inline and inline-block elements.
- The box model and
box-sizing. - Class versus id selectors and specificity.
- Semantic HTML and why it matters.
- Flexbox axes, flexbox versus grid, and making a page responsive.
Typical questions
- What is the difference between block, inline and inline-block?
- Explain the CSS box model with a diagram.
- What is the difference between class and id selectors? What is specificity?
- What is semantic HTML and why use it?
- Explain flexbox: main axis, cross axis, justify-content and align-items.
- Flexbox or grid: when do you use which?
- How do you make a website responsive?
- Build a 3-column card layout that becomes 1 column on mobile.
In a coding round you may be asked to build a small layout live. Practise the navbar, the centred box and the card grid until you can write them without looking.
A 7-day plan for HTML and CSS
- Day 1: Start with HTML and CSS, HTML tags. Build a page about yourself with headings, lists, a link and an image.
- Day 2: Forms and semantic HTML. Rebuild Day 1 with semantic tags and add a contact form.
- Day 3: CSS basics, the box model. Style your page with an external
style.css. - Day 4: Display, position and units, flexbox. Build a sticky navbar and a row of cards.
- Day 5: CSS grid, responsive layouts. Build a blog layout with grid areas that works on phone and laptop.
- Day 6: Colours, fonts and effects. Add CSS variables, hover effects and transitions, then build the pricing cards project.
- Day 7: answer the 8 practice questions from memory and build one more project from section 11, such as the photo gallery.
After the week, build one small page every week. Copying the layout of a real website is good practice.
Who these notes are for
- Complete beginners who want to start web development.
- B.Tech, BCA, MCA and B.Sc students who have a web design or web technologies lab.
- Students joining a full stack or front-end course who want a quick base before React.
- Freshers revising HTML and CSS before front-end or full stack interviews.
Once you are comfortable with HTML and CSS, move on to the JavaScript notes, then Bootstrap or React. For interview answers, pair these notes with the HTML and CSS Interview Questions PDF.
Download HTML CSS Notes PDF
HTML CSS Notes PDF: Tags, Flexbox, Grid, Layouts
The PDF carries the same content as this page in a clean, print-ready layout, so you can read it offline and keep it for revision.
10 pages · 138 KB · PDF · Updated 5 Nov 2026