Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

HTML Forms : Methods and Label Tag

Good night everyone. I would like to learn a few things.

1) What is the difference between "post" and "get" (methods for forms)?

2) I tried to give a color to my label element on the css to colorize the "Name:" "Password:" etc. , but it didn't work out. Could somebody tell me why?

Thanks and have a nice weekend(soon)!

1 Answer

Hi Atlas,

The GET method is the method used by the browser to ask the server to send back a given resource: "Hey server, I want to get this resource." In this case, the browser sends an empty body. Because the body is empty, if a form is sent using this method, the data sent to the server is appended to the URL.

The POST method is a little different. It's the method the browser sends the server to ask for a response that takes into account the data provided in the body of the HTTP request: "Hey server, take a look at this data and send me back an appropriate result." If a form is sent using this method, the data is appended to the body of the HTTP request.

As for changing the colour of the text in your form, you could give it an id then use that to change the colour.

Hope this helps.