Is there a way to edit css of new google forms?

2020-02-26 05:50发布

问题:

Before I used to be able to just copy the source code of the form and paste the part between <form></form> into the page and add my own styling. But this doesn't seem to work anymore. Has anyone found a way to still be able to customize google forms?

回答1:

Yes, you can easily make the <form> work by following these steps.

  1. Create a Google Form.
  2. Get the link and open the form in a new tab.
  3. Create a barebone form having same items as the Google form.
  4. Inspect Google form for action attribute.
    1. a. Copy the same action to your form.
  5. Inspect and find values for attributes name in the Google form.
    1. a. Give the same name values for your form items as well. The values look like entry.742532386.
  6. Check if your form gets the responses.

Since it is a native <form> element, apply CSS however you want to.

Read more here



回答2:

Here's a script that allows you override the CSS styles of a Google form:

http://googleformrestyler.apixml.net/

What it does, is it pulls down the content of the google form using a CORS proxy, then writes the HTML content of the form directly onto the page using Document.write. After which, you have complete control to edit the CSS and Javascript of the google form.