일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- bitcoin
- REACT
- nextJS
- web
- JavaScript
- evm
- Props
- error
- hardhat
- 삶
- typeScript
- CLASS
- Interface
- built in object
- HTML
- SSR
- middleware
- solidity
- CSS
- Redux
- tailwindcss
- blockchain
- concept
- Ethereum
- express.js
- graphQL
- useState
- API
- 기준
- node.js
- Today
- Total
ReasonJun
CSS : Properties (1) (uint, width, height, margin, padding) 본문
CSS : Properties (1) (uint, width, height, margin, padding)
ReasonJun 2023. 6. 5. 16:27css unit
px : pixels
% : relative percentage
em : font size of the element
Default HTML font size = 16px
html {
font-size: 16px;
}
width: 10em = 160 px
rem : font size of root element
vw : percentage of viewport width
vh : percentage of viewport vertical width
width, height
horizontal/vertical width of the element
- auto: browser calculates the width
- Specify in units such as px, em, vw, etc.
max-width, max-height
Maximum horizontal/vertical width an element can grow to
- none: no maximum width limit
- Specify in units such as px, em, vw, etc.
min-width, min-height
Minimum horizontal/vertical width an element can become smaller
- 0 : No minimum width limit
- Specify in units such as px, em, vw, etc.
margin
A 'shorthand attribute' that specifies the 'outside margin' of an element
- 0 : no outer margin
- Browser calculates margins
- Designate in units such as px, em, vw, etc.
- Negative number allowed
margin: 10px;
// top, right, bottom, left
margin: 10px 20px;
// top, bottom / left, right
margin: 10px 20px 30px;
// top / left, right / bottom
margin: 10px 20px 30px 40px;
// top / right / bottom / left
padding
A 'shorthand attribute' that specifies the 'inner padding' of an element
- 0 : no inner margin
- Specify in units such as px, em, vw, etc.
- %: specified as a percentage of the horizontal width of the parent element
padding: 10px;
// top, right, bottom, left
padding: 10px 20px;
// top, bottom / left, right
padding: 10px 20px 30px;
// top / left, right / bottom
padding: 10px 20px 30px 40px;
// top / right / bottom / left
'Frontend > CSS' 카테고리의 다른 글
CSS : display / opacity / font / character / background (0) | 2023.06.05 |
---|---|
CSS : properties (2) (border, box-sizing, overflow) (0) | 2023.06.05 |
CSS : selector priority / style inherit (0) | 2023.06.05 |
CSS : Pseudo-Classes / Pseudo-Elements / Attribute (0) | 2023.06.05 |
CSS : Basic (declaration method, css selector) (0) | 2023.06.05 |