Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

How to apply CSS on a form page?

Started by Muut Archive 10 years ago · 2 replies · 517 views
10 years ago

I successfully created a contact page. The only problem i have is, that the input fields use the whole screen width. I'd like them to be in a centered box in the middle of the page. How can i do that?
I already tried to add a <div> to the corresponding form.html.twig but that doesn't work. The twig seems to be only applied to the title of the page. Suggestions?

10 years ago

I'm using this to set a maximum width of 24rem and center all forms on my site:

---css
form {
max-width: 24rem;
margin: auto;
}

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 2555 9 years ago
Archive · by Muut Archive, 9 years ago
2 1685 9 years ago
Archive · by Muut Archive, 9 years ago
2 4972 9 years ago
Archive · by Muut Archive, 9 years ago
1 3797 9 years ago
Archive · by Muut Archive, 9 years ago
3 1795 9 years ago