-2

i got the script from codepen . i want to add some text and table in the middle of the page.

i am not good at css.

i have tried like this: CSS:

   .content{
  top : 100
  weight : 300
}

HTML:

 <H1>TITLE</H1> 
 <br />
    <table border=1>
      <tr>
        <td>qdf</td>
         <td>qdf</td>
      </tr>
    </table>

i know that the parent class is slide and it has property flex: 1 0 100%;

i google it about flex, it mean flexible. i don't know what is the number present for

1 0 100%

how can i add <li class="slide"><div class="content">title and table here</div></li>

i know table is oldfashion way of html, i don't know the css subtitute for html table.

i edited acording to mplungjan but how can i make a brekline between title and table ?

user609511
  • 4,091
  • 12
  • 54
  • 86
  • 1
    Does this answer your question? [How can I center text (horizontally and vertically) inside a div block?](https://stackoverflow.com/questions/5703552/how-can-i-center-text-horizontally-and-vertically-inside-a-div-block) – Sigurd Mazanti Nov 10 '22 at 13:46
  • `top : 100` - that is a) missing the unit, and b) `top` only works on positioned elements. `weight : 300` - weight? Did you mean `width`? (Would also be missing a unit then.) – CBroe Nov 10 '22 at 13:53

1 Answers1

1

Make the LI a flexbox too

https://codepen.io/mplungjan/pen/oNyZZBV

.slide {
  width: 100%;
  height: 100%;
  flex: 1 0 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
mplungjan
  • 169,008
  • 28
  • 173
  • 236