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{ +

+ } + +

+
+
+ +
+ +
+
+ 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? +

    +
    +