نتیجه
امتحان کنید
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body { margin: 0; font-family: Arial, Helvetica, sans-serif; direction: rtl; } .topnav { position: relative; overflow: hidden; background-color: #333; } .topnav a { float: right; color: #f2f2f2; text-align: center; padding: 14px 16px; text-decoration: none; font-size: 17px; } .topnav a:hover { background-color: #ddd; color: black; } .topnav a.active { background-color: #4CAF50; color: white; } .topnav-centered a { float: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .topnav-right { float: left; } /* Responsive navigation menu (for mobile devices) */ @media screen and (max-width: 600px) { .topnav a, .topnav-right { float: none; display: block; } .topnav-centered a { position: relative; top: 0; left: 0; transform: none; } } </style> </head> <body> <!-- Top navigation --> <div class="topnav"> <!-- Centered link --> <div class="topnav-centered"> <a href="#home" class="active">خانه</a> </div> <!-- Left-aligned links (default) --> <a href="#news">اخبار</a> <a href="#contact">تماس با ما</a> <!-- Right-aligned links --> <div class="topnav-right"> <a href="#search">جستجو</a> <a href="#about">درباره ما</a> </div> </div> <div style="padding-right:16px"> <h2>نوار منو ریسپانسیو بهمراه لینک های مرکزی و راست چین در بالا صفحه</h2> <p>اندازه پنجره مرورگر را تغییر دهید تا تاثیر قابلیت ریسپانسیو را ببینید</p> </div> </body> </html>
امتحان کنید