Posts

Showing posts from March, 2024

Variable in CSS

  <! DOCTYPE html > < html lang =" en ">   < head >     < meta charset =" UTF-8 " />     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 " />     < title >Css Variables</ title >     < style >       : root {         --color : rgb ( 255 , 0 , 247 );         --seccolor : rgb ( 231 , 164 , 246 );         --defpad : 23 px ;         --defop : 0.4 ;       }       * {         margin: 0 ;         padding: 0 ;       }       . nav {         background-color: var ( --color );       }       ul {         display: flex ;       }       ul li {         opacity:...

Transition Property in CSS

  <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >CSS Transitions</ title >     < style >         . container {             background-color: antiquewhite ;             width: 50 vw ;             height: 40 vh ;         }         . box {             background-color: aquamarine ;             width: 5 vw ;             height: 4 vh ;             /* transition-property: background-color, transform;             transition-duration: 3s;             ...

Transform in CSS

  <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >Css Transform</ title >     < style >         * {             margin: 0 ;             padding: 0 ;         }         . box {             height: 50 px ;             width: 50 px ;             background-color: beige ;             border: 2 px solid black ;             transform: rotate ( 0.125 turn );             transform-origin: -50 % -50 % ;             /* transform: rotateZ(9deg); */ ...

Text decoration in CSS

  <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >Fonts</ title >     < style >         @ import url (' https://fonts.googleapis.com/css2?family=Baloo+Bhai+2&family=Poppins:wght@300&display=swap ');         h1 {             font-family: ' Poppins ', ' Lucida Sans ', ' Lucida Sans Regular ', ' Lucida Grande ', ' Lucida Sans Unicode ', Geneva, Verdana , sans-serif         }         p {             /* font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; */             font-family: ' Baloo Bhai 2 ', sans-serif ;             font-size: 20 px ;    ...

Shadow outline in CSS

  <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >Document</ title >     < style >         . box {             border: 2 px solid black ;             padding: 34 px ;             box-shadow:   5 px 15 px 5 px #70a711;             border-radius: 8 px ;             outline-offset: 20 px ;         }         . text-element { text-shadow: 10 px 5 px 3 px #e695f7 }     </ style > </ head > < body >     < div class =" box ">         I am a box     </ div >     < ...

Selecters in CSS

  <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >CSS Selectors</ title >     < style >         /* Element Selector  */         div {             background-color: red ;         }         /* Class Selector  */         . red {             background-color: red ;         }         /* Id Selector */         # green {             background-color: green ;         }         /* Child Selectors  */         div > p {          ...

Position property in CSS

  <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >CSS Position</ title >     < style >         * {             margin: 0 ;             padding: 0 ;         }         . box {             height: 433 px ;             width: 80 vw ;             padding: 3 px ;             margin: 3 px ;             border: 2 px solid black ;         }         . box1 {             background-color: rgb ( 127 , 209 , 209 );        ...

Overflow in CSS

  <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >Overflow</ title >     < style >         . box {             width: 30 vw ;             height: 30 vh ;             border: 2 px solid black ;             /* overflow: auto;             overflow-x: hidden;             overflow-y: scroll; */             overflow: auto hidden ;             /* white-space: nowrap;             text-overflow: ellipsis; */         }     </ style > </ head > <...

Object fit and Object cover

  <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >CSS object Fit and position</ title >     < style >         . container {             height: 488 px ;             width: 466 px ;             border: 2 px solid black ;             /* background-color: azure; */             background-position: center center ;             background-clip: border-box ;             background-image: url (" https://us.123rf.com/450wm/progressman/progressman1909/progressman190900115/130695651-woman-in-black-coat-walking-along-the-sea.jpg?ver=6 ");   ...

Media Quarry in CSS

  <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >CSS media query</ title >     < style >         body {             background-color: red ;         }         @ media screen and (orientation: portrait ) {             body {                 border: 2 px solid purple ;             }         }         @ media only screen and (max-width: 455 px ){             body {                 background-color: blue ;             }     ...

List in CSS

  <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >CSS Lists</ title >     < style >         nav ul li {             list-style: devanagari ;             list-style-type: " 🔥 ";             /* background-color: yellow; */             /* list-style-position: inside; */             border: 2 px solid black ;             /* list-style: disc inside url("https://user-images.githubusercontent.com/14011726/94132137-7d4fc100-fe7c-11ea-8512-69f90cb65e48.gif"); */             /* list-style-image: url("https://user-images.githubusercontent.com/14011...

Grid in CSS

  <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >CSS Grid</ title >     < style >         . container {             width: 80 vw ;             height: 100 vh ;             border: 2 px solid black ;             display: grid ;             /* grid-template-columns: [pehla] 120px [doosra] 100px [t]; */             /* grid-template-rows: 100px 100px 100px; */             /* grid-template-columns: repeat(4, minmax(100px, 1fr)); */             grid-template-columns: repeat ( 4 , 80 px );       ...

Font in CSS

  <! DOCTYPE html > < html lang =" en ">   < head >     < meta charset =" UTF-8 " />     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 " />     < title >Document</ title >     < link rel =" preconnect " href =" https://fonts.googleapis.com " />     < link rel =" preconnect " href =" https://fonts.gstatic.com " crossorigin />     < link       href =" https://fonts.googleapis.com/css2?family=Protest+Revolution&display=swap "       rel =" stylesheet "     />     < style >       . box {         background-color: yellow ;       }       . box1 {         color: tomato ;         padding: 20 px ;         margin: 25 px ;         b...

Float and Clear in CSS

  <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >CSS Float & Clear</ title >     < style >         . cards {             border: 2 px solid black ;             display: flow-root ;         }                 img {             float: left ;         }         . card {             border: 2 px solid red ;         }         . card : nth-child ( 3 ){             background-color: aqua ;             clear: both ;     ...

Flex box in CSS

  <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >CSS Flexbox</ title >     < style >         . container {             border: 2 px solid red ;             display: flex ;             height: 80 vh ;             /* justify-content: center; */             align-items: center ;             /* flex-direction: column; */             flex-wrap: wrap ;             /* align-content: flex-start; */             /* there is no justify-items  in flexbox; */         ...