Common Things

 bash video

1. pwd  //present directory

2. cd  // to change directory

3. ls   // to see the directory and files

4.mkdir //to create directory

5. touch // to create file

6. cat

7. vi

8. mv  hello.cpp  ../Dev   // move file   source and destination

8. mv  hello.cpp rename.cpp  // to rename the file  [{old name} {new name}]

9. cp




''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Relative Units

EM: Relative to the parent element

REM: Relative to the root element (HTML tag)

%: Relative to the parent element

VW: Relative to the viewport’s width

VH: Relative to the viewport’s height

So what do these units mean when dealing with the default of 16px?

The number you specify will multiply that number times the default size.

1em = 16px (1 * 16)

2em = 32px (2 * 16)

.5em = 8px (.5 * 16)


1rem = 16px

2rem = 32px

.5rem = 8px


100% = 16px

200% = 32px

50% = 8px


Ok, great, but what if either you or the user changes the default size? Because these are relative units, the final size values will be based off of the new base size. Although the default is 16px, if you or the user changed it to 14px, then the calculated sizes would end up being:


1em = 14px (1 * 14)

2em = 28px (2 * 14)

.5em = 7px (.5 * 14)


1rem = 14px

2rem = 28px

.5rem = 7px


100% = 14px

200% = 28px

50% = 7px



// css

body {
  font-size: 16px; /* absolute unit */
}

h1 {
  font-size: 1em; /* relative to parent font size */
}

h2 {
  font-size: 1rem; /* relative to root font size */
}

header {
  height: 20vh; /* relative to viewport height */
}
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

//to install wsl for windows

Manual installation steps for older versions of WSL | Microsoft Learn

Comments

Popular posts from this blog

CyberSecurity

VERTICAL SCALING 💋

prisma using in project idx 13.3