From 8d3f8ec375fea81095fb0275de67cb08dfbc6642 Mon Sep 17 00:00:00 2001 From: Jagrit Date: Sat, 28 Aug 2021 15:26:39 +0530 Subject: [PATCH] Added q12 to CSS --- css/answers/jagrit-q12.html | 84 +++++++++++++++++++++++++++++++++++++ css/index.html | 7 ++++ 2 files changed, 91 insertions(+) create mode 100644 css/answers/jagrit-q12.html diff --git a/css/answers/jagrit-q12.html b/css/answers/jagrit-q12.html new file mode 100644 index 0000000..d07fc71 --- /dev/null +++ b/css/answers/jagrit-q12.html @@ -0,0 +1,84 @@ + + + + + + + + + + CSS | InterQues | Coding Ninjas + + + + + + + + + +
+ Coding Ninjas Logo +
+ +
+

+ + + Home + > CSS Questions + > How will you bring a child element in the center of its parent element with the help of flexbox? + + + +

+
+ + +
+
+

+ Q : How will you bring a child element in the center of its parent element with the help of flexbox? +

+
+
+
+ Answer: +

+ We can perform this task by first setting the display of the child element to flex. Then,We + will set the justify content and align-items property to center. + Make sure to apply height to the parent element otherwise the align-items property won't work. +
+ Following is the code: +
+ child{ +

    +
  • display:flex
  • +
  • justify-content:center
  • +
  • align-items:center
  • +
+ } + +

+
+
+ +
+ +
+
+ Similar Questions +
+ +
+ + + + \ No newline at end of file diff --git a/css/index.html b/css/index.html index 10a4659..da684b1 100644 --- a/css/index.html +++ b/css/index.html @@ -140,6 +140,13 @@

+
  • + +

    + How will you bring a child element in the center of its parent element with the help of flexbox? +

    +
    +