<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatib1e" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> < link rel="stylesheet" href="style.css"> <title>Document</title> </head> <body> <h1>Lorem ipsum dolor sit amet.</hl> <div class="sticky"> <nav> <a href="">خانه</a> <a href="">وبلاگ</a> <a href="">دوره های اموزشی</a> </nav> </div> </body> </html> file style.css div.sticky{ position: sticky; top: 0; padding: 5px; background-color: steelblue; border: 1px solid black; } a{ text-decoration :none; padding: 15px; font-size: 25px; color:snow; } nav{ text-align: center; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter