Why are my buttons not working correctly? |
Why are my buttons not working correctly? |
ironpastry |
Mar 22 2019, 11:49 AM
Post
#1
|
Group: Members Posts: 1 Joined: 22-March 19 Member No.: 26,858 |
I have to make a website for a school project. My buttons were working correctly but then I tried to put them in a line and now if you go to the website you cannot leave the homepage(cookingforcollege.net). Can someone tell me why and how to fix it? Thanks!
Code: <!DOCTYPE html> <html> <head> <title>Home</title> </head> <body> <center style="color:red;font-size:40px;">Cooking For College</center> <style> form { display: inline; } </style> <form action="/index.html" method="get" > <button type="submit">Home</button> <method="get" action="/breakfast.html"> <button type="submit">Breakfast</button> <method="get" action="/lunch.html"> <button type="submit">Lunch</button> <method="get" action="/dinner.html"> <button type="submit">Dinner</button> <method="get" action="/about.html"> <button type="submit">About</button> </form> </body> </html> |
Christian J |
Mar 22 2019, 01:12 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,630 Joined: 10-August 06 Member No.: 7 |
Each button needs its own form, each with a different URL in the ACTION attribute.
|
pandy |
Mar 22 2019, 06:45 PM
Post
#3
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,716 Joined: 9-August 06 Member No.: 6 |
Yeah. With a start and end tag. You can't put the attributes (action and method) in their own tag as you've done.
That said, this isn't a good method. Use real links. Style them to look as buttons if you wish. |
Christian J |
Mar 22 2019, 07:00 PM
Post
#4
|
. Group: WDG Moderators Posts: 9,630 Joined: 10-August 06 Member No.: 7 |
|
CharlesEF |
Mar 22 2019, 07:30 PM
Post
#5
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
Not to mention that <style> goes in the <html> section not the <body>
|
Lo-Fi Version | Time is now: 28th March 2024 - 07:45 AM |