@@ -3001,44 +3001,47 @@ Percentage units allow you to define dimensions, margins, and padding relative t
30013001
30023002``` css
30033003.container {
3004- background-color : #ff0000 ;
3005- width : 90% ; /* Set container width to 90% of the viewport */
3004+ background-color : #ff0000 ;
3005+ margin : 5% ;
3006+ padding : 5% ;
3007+ width : 90% ; /* Set container width to 90% of the viewport */
30063008}
30073009
30083010.column {
3009- background-color : #f1f1f1 ;
3010- width : 50% ; /* Set column width to 50% of the container */
3011+ background-color : #f1f1f1 ;
3012+ padding : 10% ;
3013+ width : 50% ; /* Set column width to 50% of the container */
30113014}
30123015```
30133016
30143017[ ![ Edit 074-Percentage (%)] ( images/codesandbox.svg )] ( https://codesandbox.io/p/sandbox/074-percentage-ct6wzy )
30153018
30163019[ ^ 74 ] CodeSandbox: Percentage (%).
30173020
3018- [ ^ 74 ] :[ CodeSandbox: Percentage (%)] ( https://ct6wzy.csb.app/ ) , last access: June 20, 2024 .
3021+ [ ^ 74 ] :[ CodeSandbox: Percentage (%)] ( https://ct6wzy.csb.app/ ) , last access: March 10, 2025 .
30193022
30203023###### Viewport Width (vw) and Viewport Height (vh)
30213024
30223025Viewport units represent a percentage of the viewport's width or height, allowing you to create responsive designs based on the size of the viewport.
30233026
30243027``` css
30253028.text {
3026- background-color : #ff0000 ;
3027- font-size : 5vw ; /* Set font size to 5% of the viewport width */
3029+ background-color : #ff0000 ;
3030+ font-size : 5vw ; /* Set font size to 5% of the viewport width */
30283031}
30293032
30303033.box {
3031- background-color : #f1f1f1 ;
3032- width : 50vw ; /* Set box width to 50% of the viewport width */
3033- height : 50vh ; /* Set box height to 50% of the viewport height */
3034+ background-color : #f1f1f1 ;
3035+ width : 50vw ; /* Set box width to 50% of the viewport width */
3036+ height : 50vh ; /* Set box height to 50% of the viewport height */
30343037}
30353038```
30363039
30373040[ ![ Edit 075-Viewport Width (vw) and Viewport Height (vh)] ( images/codesandbox.svg )] ( https://codesandbox.io/p/sandbox/075-viewport-width-vw-and-viewport-height-vh-ckqpy3 )
30383041
30393042[ ^ 75 ] CodeSandbox: Viewport Width (vw) and Viewport Height (vh).
30403043
3041- [ ^ 75 ] :[ CodeSandbox: Viewport Width (vw) and Viewport Height (vh)] ( https://ckqpy3.csb.app/ ) , last access: June 25, 2024 .
3044+ [ ^ 75 ] :[ CodeSandbox: Viewport Width (vw) and Viewport Height (vh)] ( https://ckqpy3.csb.app/ ) , last access: March 10, 2025 .
30423045
30433046###### Viewport Settings
30443047
@@ -3054,6 +3057,7 @@ Let's have an example of Responsive Meta Tag.
30543057 </head >
30553058 <body style =" background-color : grey " >
30563059 <!-- Content -->
3060+ <h1 >Test</h1 >
30573061 </body >
30583062</html >
30593063```
@@ -3062,7 +3066,7 @@ Let's have an example of Responsive Meta Tag.
30623066
30633067[ ^ 76 ] CodeSandbox: Viewport Settings.
30643068
3065- [ ^ 76 ] :[ CodeSandbox: Viewport Settings] ( https://7gjptw.csb.app/ ) , last access: June 25, 2024 .
3069+ [ ^ 76 ] :[ CodeSandbox: Viewport Settings] ( https://7gjptw.csb.app/ ) , last access: March 10, 2025 .
30663070
30673071- The ` viewport ` meta tag is included in the ` <head> ` section of the HTML document.
30683072- The ` width=device-width ` property sets the width of the viewport to the device's screen width.
0 commit comments