الصفحة الرئيسية
تحميل الكود
تغيير الألوان
تغيير العرض
تغيير حجم العرض
تشغيل الكود
<!DOCTYPE html> <html> <head> <style> body { margin: 0; } ul { margin: 0; padding: 0; list-style-type: none; background-color: #282a35; overflow: hidden; position: sticky; top: 0; width: 100%; } li { float: left; } li a { display: block; color: white; padding: 12px 16px; text-decoration: none; } li a:hover:not(.active) { background-color: black; } .active { background-color: darkcyan; } </style> </head> <body> <h1 style="padding: 15px;">Sticky Navigation Bar</h1> <ul> <li><a href="#home">Home</a> <li><a href="#services">Services</a> <li><a href="#contact">Contact</a> <li><a href="#about" class="active">About</a> </ul> <div style="padding: 0 15px 2000px 15px;"> <p>scroll down to see how the navbar will stick at the top.</p> <p>scroll down to see how the navbar will stick at the top.</p> <p>scroll down to see how the navbar will stick at the top.</p> <p>scroll down to see how the navbar will stick at the top.</p> <p>scroll down to see how the navbar will stick at the top.</p> <p>scroll down to see how the navbar will stick at the top.</p> </div> </body> </html>