margin.rs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. use dioxus::prelude::*;
  2. fn main() {
  3. let mut dom = VirtualDom::new(app);
  4. dom.rebuild();
  5. rink::render_vdom(&dom).unwrap();
  6. }
  7. fn app(cx: Scope) -> Element {
  8. cx.render(rsx! {
  9. div {
  10. width: "100%",
  11. height: "100%",
  12. flex_direction: "column",
  13. background_color: "black",
  14. // margin_right: "10px",
  15. div {
  16. width: "70%",
  17. height: "70%",
  18. // margin_left: "4px",
  19. background_color: "green",
  20. div {
  21. width: "100%",
  22. height: "100%",
  23. margin_top: "2px",
  24. margin_bottom: "2px",
  25. margin_left: "2px",
  26. margin_right: "2px",
  27. // flex_shrink: "0",
  28. background_color: "red",
  29. justify_content: "center",
  30. align_items: "center",
  31. flex_direction: "column",
  32. // padding_top: "2px",
  33. // padding_bottom: "2px",
  34. // padding_left: "4px",
  35. // padding_right: "4px",
  36. "[A]"
  37. "[A]"
  38. "[A]"
  39. "[A]"
  40. }
  41. }
  42. }
  43. })
  44. }