Revise examples a little bit.

This commit is contained in:
Jacob 2024-05-13 00:57:27 +02:00
parent 27ff72f2a5
commit 8ba0aff55c
2 changed files with 7 additions and 12 deletions

View file

@ -15,10 +15,8 @@ int main() {
html.push_back({"title", {}, "Google"}); html.push_back({"title", {}, "Google"});
docpp::CSS::Stylesheet sheet{}; docpp::CSS::Stylesheet sheet{{
{".center", {
sheet.push_back(docpp::CSS::Element(
".center", {
{"display", "flex"}, {"display", "flex"},
{"flex-wrap", "wrap"}, {"flex-wrap", "wrap"},
{"justify-content", "center"}, {"justify-content", "center"},
@ -26,14 +24,11 @@ int main() {
{"font-size", "10vw"}, {"font-size", "10vw"},
{"height", "10vw"}, {"height", "10vw"},
{"padding", "10vw"}, {"padding", "10vw"},
} }},
)); {"input[type=text], select", {
sheet.push_back(docpp::CSS::Element(
"input[type=text], select", {
{"width", "50vw"}, {"width", "50vw"},
} }},
)); }};
html.push_back({"style", {}, sheet.get(docpp::CSS::FORMATTING_PRETTY)}); html.push_back({"style", {}, sheet.get(docpp::CSS::FORMATTING_PRETTY)});

View file

@ -28,7 +28,7 @@ int main() {
* *
* Note that it is very important that you do not append a section or element to a section until you have finished its construction, * Note that it is very important that you do not append a section or element to a section until you have finished its construction,
* because push_back() makes a copy of the object you pass to it. If you need to make changes later, you can use methods such as find() and swap(), * because push_back() makes a copy of the object you pass to it. If you need to make changes later, you can use methods such as find() and swap(),
* or construct a new object. * or construct a new object. An alternative is to append using the += operator, which does the same thing as push_back().
* *
* To get the section as an std::string object, call section.get(). * To get the section as an std::string object, call section.get().
*/ */