Classification and Positioning Properties

PropertyPossible ValuesDescription
displayblock, inline, inline-block, flex, grid, noneDefines how an element is displayed
visibilityvisible, hidden, collapseControls whether an element is visible
overflowvisible, hidden, scroll, autoSpecifies how content overflows its box
z-indexauto, numberControls the stack order of elements (higher number appears in front)
opacity0 to 1 (decimal)Controls element transparency (0 = invisible, 1 = fully visible)

PropertyPossible ValuesDescription
positionstatic, relative, absolute, fixed, stickyDefines how an element is positioned
toppx, %, autoMoves element from the top edge (for relative, absolute, fixed)
rightpx, %, autoMoves element from the right edge
bottompx, %, autoMoves element from the bottom edge
leftpx, %, autoMoves element from the left edge
floatleft, right, noneMoves an element to the left or right
clearleft, right, both, nonePrevents elements from floating next to each other

Explanation of position Values

ValueBehavior
staticDefault positioning (normal document flow)
relativeMoves relative to its original position
absoluteMoves relative to the nearest positioned ancestor
fixedStays fixed in place even when scrolling
stickySticks to a position until scrolled past

Example:

.box {
    width: 200px;
    height: 100px;
    position: absolute;
    top: 50px;
    left: 100px;
    background-color: lightblue;
}

✔ Moves 50px from the top

✔ Moves 100px from the left

✔ Absolute positioning relative to the nearest positioned ancestor

Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2025 Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz