<!DOCTYPE html> <html> <head> <style> #t { background: green; position: absolute; width: 100%; left: 0; height: 10px; top: 0; } </style> </head> <body> <div style="position: relative; display: inline; color: white; background: white;">ABCDEF<div id="t"></div></div> <body> </html>