I wanted a code that would show the flags of two countries, Iran and England, as a…
- User
I wanted a code that would show the flags of two countries, Iran and England, as a drop-down and after clicking on each of the flags, it would go to the desired URL.
- Assistant
- User
I want Iranian and English language links to my two favorite pages
- Assistant
Certainly! You can update the dropdown options to include links to your favorite pages in both Iranian and English languages. Below is a modified version of the previous code where you can specify your favorite URLs for each language's page:
- User
it doesn't work I want to go to azmayesh-group.ir when the user clicks on Farsi And when the user clicks on English, he will go to azmayesh-group.ir/en
- Assistant
Sure! Let's update the code accordingly so that selecting the "Farsi" option redirects to
http://azmayesh-group.ir, and selecting the "English" option redirects tohttp://azmayesh-group.ir/en.Here is the revised HTML code:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Language Dropdown</title> <style> body { font-family: Arial, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #f0f0f0; } select { padding: 10px; font-size: 16px; } </style> </head> <body> <select id="languageSelect" onchange="redirectToURL()"> <option value="">Select a language</option> <option value="http://azmayesh-group.ir">Farsi (فارسی)</option> <option value="http://azmayesh-group.ir/en">English</option> </select> <script> function redirectToURL() { var select = document.getElementById('languageSelect'); var url = select.value; if (url) { window.location.href = url; } } </script> </body> </html> - User
With this code, half of the page is locked and does not go up, why? It seems that something does not allow scrolling
- Assistant
- User
Again, it was a mistake and half of the page is locked, this code is being added to the WordPress Woodmart header
- Assistant
- User
I want it to be written with a language and an SVG icon of the globe next to it
- Assistant