reading-notes

View on GitHub

Grid and RegEx

Grid

grid is styling way in css for containers.
to use grid you need to assign the value grid to the property display.

  .conatiner{
    display: grid;
  }

to assign the number of rows or columns in a grid, you need to use the grid-template-columns or grid-template-rows.
and assigning them values of the number of rows and columns.

  .conatiner{
    display: grid;
    grid-template-rows: 1fr 1fr;
    grid-template-columns: 25% 25% 25% 25%;
  }

the above styling makes 2 rows with 4 columns in each.

to add gab to columns, rows or both use the following

RegEx

regular expression or regex is a way of searching and exttracting data from text (string).

to create regular expression object you need to put your text in between tow forward slashes.
and also you can creat regex object by passing your text as argument in RegExp function.

  let text = "hello" // this is a string
  let text2 = /hello/ //this is regex object
  let text3 = RegExp(text); //this is regext object

some patterns in RegEx: