DEV Community

Cover image for Scoping in HTML
Saami abbas Khan
Saami abbas Khan

Posted on

Scoping in HTML

This is a submission for the Web Game Challenge: One Byte Explainer

Explainer

In HTML, there are two types of elements: block and inline. Block elements (e.g. <div>) cover the entire line, while inline elements (e.g., <span>) occupy only the necessary space. A block element can't be wrapped inside an inline element like <span>.

Additional Context

If we wrap a <div> (a block element) with a <span> tag, it will behave unexpectedly. For example, applying a background color to that <span> element will only partially work. Remember to always wrap inline elements (like ) with block elements (like ), not the other way around.

@saamiabbaskhan

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

đź‘‹ Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay