tvote.c: various css improvements - vote - simple cgi voting system for web and gopher
(HTM) git clone git://src.adamsgaard.dk/vote
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 799aa192f31b743ef61a3485b473b6fea11eaa7f
(DIR) parent fea90f097b99c13d3a5bf7bb6f8c80a711a0ebe0
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Mon, 28 Sep 2020 17:55:43 +0200
vote.c: various css improvements
Diffstat:
M vote.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
---
(DIR) diff --git a/vote.c b/vote.c
t@@ -65,7 +65,7 @@ void
print_html_head()
{
printf("Content-type: text/html; charset=utf-8\r\n\r\n");
- printf("<!DOCTYPE html>\n"
+ puts("<!DOCTYPE html>\n"
"<html>\n"
"<head>\n"
" <style type=\"text/css\">\n"
t@@ -73,14 +73,19 @@ print_html_head()
" margin: 1em auto;\n"
" max-width: 40em;\n"
" padding: 0 .62em;\n"
- " font: 1.2em/1.62 sans-serif;\n"
+ " font: 16px/1.62 sans-serif;\n"
+ " line-height: 1.3;\n"
" }\n"
" h1, h2, h3 {\n"
" line-height: 1.2;\n"
" }\n"
- " table.create, input.name,\n"
- " textarea.question, textarea.options: {\n"
- " width: 100%%;\n"
+ " td.choice {\n"
+ " padding: .5em;\n"
+ " }\n"
+ " table.create, td.input, input.name,\n"
+ " textarea.question, textarea.options {\n"
+ " box-sizing: border-box;\n"
+ " width: 100%;\n"
" }\n"
" </style>\n"
"</head>\n"
t@@ -109,13 +114,14 @@ print_poll_line(char *line, size_t *i, int intable, int vote)
}
}
if (vote) {
- printf("\t<tr><td>");
+ printf("\t<tr><td class=\"choice\">");
printf("<input type=\"radio\" "
"id=\"%ld\" name=\"choice\" value=\"%ld\" />",
++*i, *i);
printf("</td><td>%s</td></tr>\n", options);
} else
- printf("\t<tr><td>%ld</td><td>%s</td></tr>\n", c, options);
+ printf("\t<tr><td class=\"choice\">%ld</td><td>%s</td></tr>\n",
+ c, options);
return 1;
} else {
t@@ -337,8 +343,7 @@ print_poll_create_form()
"<tr>\n"
" <td width=\"100%\" class=\"input\">\n"
" <input type=\"text\" name=\"poll\" "
- "placeholder=\"Name\" "
- "autofocus=\"autofocus\" class=\"name\" />\n"
+ "placeholder=\"Name\" class=\"name\" />\n"
" </td>\n"
"</tr>\n"
"<tr>\n"