Width, Height and Overflow
๐ Covered in this chapter:
width ยท height ยท min-width ยท max-width ยท min-height ยท max-height ยท overflow ยท overflow-x/y ยท overflow-wrap ยท Text Clipping ยท Scroll Containers
Welcome to Chapter 14: Width, Height and Overflow โ part of the CSS Complete Roadmap. This lesson covers all subtopics with clear explanations, code examples, and best practices used in professional web development.
1Width & Height Properties
.panel {
width: 100%;
max-width: 640px;
min-width: 280px;
height: auto;
min-height: 200px;
max-height: 80vh;
}
width/height: auto โ content size batti adjust avuthundi. Fixed dimensions responsive design lo careful ga use cheyandi.
2Overflow โ hidden, scroll, auto
CSS
.scroll-box {
max-height: 300px;
overflow-y: auto;
overflow-x: hidden;
}
.clipped {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
visibleโ content overflow (default)hiddenโ clip excess contentscrollโ always show scrollbarsautoโ scrollbars when needed
3overflow-wrap & Scroll Containers
CSS
.long-url {
overflow-wrap: break-word;
word-break: break-word;
}
.modal-body {
overflow-y: auto;
overscroll-behavior: contain;
}
Scroll containers โ modals, sidebars, chat windows ki overflow: auto + fixed height common pattern.