Show HN: I built a small browser engine from scratch in C++
created: Jan. 28, 2026, 2:03 p.m. | updated: Jan. 28, 2026, 7:47 p.m.
I've built several websites with HTML, CSS, and JavaScript, but I never really understood how the browser executing this code actually works.
C++ was entirely new to me, and I struggled with countless bugs, but I eventually completed a small browser that can parse HTML, apply CSS, and render images.
Core Classes:NODE (include/html/node.h, src/html/node.cpp) NODE_TYPE : ELEMENT, TEXT Properties: m_tag_name : element's tag name (e.g., "div", "p") m_text : text node content m_children : child nodes m_attributes : attribute map (id, class, src, etc.)
Parse CSS rules → store as CSS_RULE 2.
src/ ├── html/ # HTML parsing implementation ├── css/ # CSS & layout implementation └── gui/ # Rendering implementationSupported CSS PropertiesThis browser supports the following CSS properties.
14 hours, 15 minutes ago: Hacker News