How not to turn into a meme "backend developer doing frontend"
Congratulations! You've decided to go to an interview as a front-end developer. Most likely, you already know what semantic tags and box model are and how to center a div (spoiler: it's still not as easy as it seems 😅).
But let's be honest: between "I studied CSS" and "I passed a CSS interview" there is a whole universe of pain, suffering and questions like "do you know what BFC is?".

HTML: "These are just tags, what can go wrong?"
1. Semantics is not philosophy, it's about tags
Question: How does <div> differ from <section> and why do we need semantics at all?
What you need to know:
Semantic tags (<article>, <section>, <nav>, <header>, <footer>, <aside>) do not just make the code "more beautiful".
They:
Improve SEO (search engines love structure)
Make the site accessible to screen readers
Help developers understand the structure without reading all the code
<!-- Плохо: --><div class="article"><div class="header">Заголовок</div><div class="content">Контент</div></div>
<!-- Хорошо: --><article><header>
<h1>Заголовок</h1></header><section>Контент</section></article>Remember what they say: "Using <div> everywhere is like naming all variables data1, data2, data3". It works technically, but your colleagues will hate you.
2. HTML5 features: not only canvas and video
Top Questions 2025:
What is the difference between
<canvas>and<svg>?What are data attributes and why are they needed?
How does
localStoragevssessionStoragework?
Quick answer on canvas vs svg:
<canvas>— raster graphics, for complex animation and games<svg>— vector, for icons and scalable elements
Data attributes — your personal custom attribute storage:
<article data-post-id="12345" data-category="frontend"><!-- Можно читать через JS: article.dataset.postId --></article>3. Forms: more than just input
Question: What new types of input have appeared in HTML5?
Answer for the interviewer's impression:
type="email"— email validationtype="tel"— phone (mobile keyboard optimized)type="date",type="time"— native date pickerstype="range"— slidertype="color"— color pickerrequired,pattern,min,max— built-in validation without JS!
<input type="email" required
pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$"
placeholder="your@email.com">4. Box Model: the basis of the basics
Question: Explain the CSS Box Model and the difference between box-sizing: content-box and border-box.
Answer (remember once and for all):
Box Model consists of:
Content - the content itself
Padding - indentation inside
Border — border
Margin - outside indentation
/* content-box (default, но неудобно) */.box {
width: 200px;
padding: 20px;
border: 5px solid;
/* Итоговая ширина: 200 + 20*2 + 5*2 = 250px */
}
/* border-box (используют все адекватные люди) */.box {
box-sizing: border-box;
width: 200px;
padding: 20px;
border: 5px solid;
/* Итоговая ширина: ровно 200px */
}If you're not using * { box-sizing: border-box; } in 2026, you might be stuck in the last century 🦕
5. Flexbox vs Grid: the eternal battle
Question: When to use Flexbox and when to use Grid?
Simple rule:
Flexbox — for one-dimensional layouts (row OR column)
Grid — for two-dimensional (rows and columns at the same time)
Flexbox for navigation:
.navbar {
display: flex;
justify-content: space-between;
align-items: center;
}Grid for gallery:
.gallery {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
}Flexbox is when you want to align the elements. Grid is when you want to stop the war with float and position.

6. CSS specificity: why didn't my style apply?!
Question: Explain CSS Specificity and style priorities.
Ranking by strength (from weak to strong):
Tag selectors:
div(0,0,1)Classes:
.button(0,1,0)ID:
#header(1,0,0)Inline styles:
style="..."(1,0,0,0)!important— nuclear button (never use!)
/* Специфичность: 0,0,1 */p { color: blue; }
/* Специфичность: 0,1,0 */.text { color: red; }
/* Специфичность: 0,1,1 */p.text { color: green; } /* Этот выиграет! */
/* Специфичность: 1,0,0 */#content { color: purple; }
/* Если добавить !important — всё сломается */p { color: orange !important; } /* НЕ ДЕЛАЙТЕ ТАК */7. Pseudoclasses vs Pseudoelements: what is the difference?
Always ask questions!
Pseudoclasses (:) - element status:
a:hover { color: red; }
input:focus { border: 2px solid blue; }
li:nth-child(2) { background: yellow; }Pseudo-elements (::) - virtual elements:
p::before { content: "📌 "; }
p::after { content: " ✓"; }
::selection { background: yellow; }Life hack: One colon - state, two - element.
8. Adaptability: Mobile-First in 2026
Question: How to implement responsive design without frameworks?
Modern approach:
/* Mobile-first: базовые стили для мобилок */.container {
padding: 10px;
font-size: 14px;
}
/* Для планшетов */@media (min-width: 768px) {
.container {
padding: 20px;
font-size: 16px;
}
}
/* Для десктопов */@media (min-width: 1024px) {
.container {
max-width: 1200px;
margin: 0 auto;
padding: 40px;
}
}
BFC (Block Formatting Context): for hardcore users
Question for middle/senior: What is BFC and how to create it?
In simple words:
BFC is an isolated rendering area where elements interact according to their own rules.
Created at:
overflow: hidden/auto/scroll(notvisible)display: flow-root(modern way!)position: absolute/fixeddisplay: flex/gridon the parentfloat: left/right
/* Проблема: плавающий элемент вываливается из контейнера */.container {
border: 2px solid black;
}
.float-item {
float: left;
width: 200px;
}
/* Решение: создаём BFC */.container {
overflow: hidden; /* Старый способ *// * or */display: flow-root; /* Modern way */
}🎓 What about practice?
Theory is cool, but without practice, you will feel like a backend developer who is trying to center a div.
Here comes to the rescue Code - a mobile application for learning programming, where you can pump HTML and CSS right on the go. Metro, queue in a coffee shop, lunch break - any place turns into a coding bootcamp!
✅ Interactive lessons
with real code
✅ Practice in the app
no need for a computer!
✅ Progress is tracked
automatically
✅ Tasks by levels
from beginner to pro
And there is our Telegram community! 🚀
This is the place where:
📚 Useful posts are published every day
💬 You can ask a question and get help
🔥 Sharing our experience of passing interviews
😄 Posting memes
Subscribeto repeat the materials daily and stay up to date with trends!
HTML and CSS interviews in 2025 are not just about "do you know the tags". It's about understanding how a browser renders a page, how to optimize performance, and how to write supported code.
Golden rule: Honesty + basic knowledge + practice = offer.
Don't know the answer? Say: "I don't remember exactly now, but I know where to find this information and how to apply it." Interviewers value honesty and the ability to look for solutions more than knowing all 500 CSS properties by heart.
P.S. Remember: every senior developer once googled "how to center a div css". The difference is that now they know 5 ways to do it and can explain which one is better for a particular task.
