🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to CSS Notes
Topic #71

CSS Position Offsets


Positioning with top, right, bottom, and left

The top, right, bottom, and left properties are used to position elements.

These properties only work on positioned elements (elements with position set to relative, absolute, fixed, or sticky).


Positioning Text On an Image

How to position text on an image:

Example

<div style="position:relative;text-align:center;">
<img alt="Cinque Terre" src="img_5terre_wide.jpg" style="width:100%;height:auto;opacity:0.5"/>
<div style="position:absolute;bottom:8px;left:16px;font-size:20px">Bottom Left</div>
<div style="position:absolute;top:8px;left:16px;font-size:20px">Top Left</div>
<div style="position:absolute;top:8px;right:16px;font-size:20px">Top Right</div>
<div style="position:absolute;bottom:8px;right:16px;font-size:20px">Bottom Right</div>
<div style="position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);font-size:20px">Centered</div>
</div>

All CSS Positioning Properties

Property Description
bottom Sets the bottom margin edge for a positioned box
clip Clips an absolutely positioned element
left Sets the left margin edge for a positioned box
position Specifies the type of positioning for an element
right Sets the right margin edge for a positioned box
top Sets the top margin edge for a positioned box

Want to go beyond the notes?

Join CodingNow 2.0's CSS course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

CSS Position Offsets – FAQs

Quick answers about learning CSS Position Offsets in CSS.

This free note from CodingNow 2.0 explains CSS Position Offsets in CSS — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every CSS topic on CodingNow 2.0, including CSS Position Offsets, is 100% free with no signup required.
With focused practice, most students grasp CSS Position Offsets in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now