Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 8206

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 60k
Author
Asked: November 28, 20242024-11-28T10:58:06+00:00 2024-11-28T10:58:06+00:00

100 days CSS day 1 challenge Solution explained

  • 60k

Image description

HTML CODE

<div class="frame">   <div class="center">     <div class="number">       <div class="one-one"></div>       <div class="one-two"></div>       <div class="zero-one"></div>       <div class="zero-two"></div>     </div>     <span class="big">Days</span>     <span class="small">CSS Challenge</span>   </div> </div> 
Enter fullscreen mode Exit fullscreen mode

CSS CODE

.frame {   position: absolute;   top: 50%;   left: 50%;   width: 400px;   height: 400px;   margin-top: -200px;   margin-left: -200px;   border-radius: 2px;   box-shadow: 1px 2px 10px 0px rgba(0,0,0,0.3);   background: #43389F;   background: -webkit-linear-gradient(bottom left, #43389F 0%, #4ec6ca 100%);   background: -moz-linear-gradient(bottom left, #43389F 0%, #4ec6ca 100%);   background: -o-linear-gradient(bottom left, #43389F 0%, #4ec6ca 100%);   background: linear-gradient(to top right, #43389F 0%, #4ec6ca 100%);    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#43389F', endColorstr='#4ec6ca',GradientType=1 );    font-family: 'Courier New', 'Courier', sans-serif;   color: #fff;   -webkit-font-smoothing: antialiased;   -moz-osx-font-smoothing: grayscale; }  .center {   position: absolute;   top: 50.8%;   left: 50.5%;   transform: translate(-50%,-50%); }  .number {   position: relative;   height: 100px;   width: 200px;    .one-one {     position: absolute;     z-index: 1;     top: 0;     left: -16px;     height: 40px;     width: 20px;     background: #fff;     border-radius: 3px;     transform: rotate(50deg);     box-shadow: 0 0 13px 0 rgba(0,0,0,0.2);   }    .one-two {     position: absolute;     z-index: 10;     top: 0;     left: 0px;     height: 100px;     width: 24px;     background: #fff;     border-radius: 3px;     box-shadow: 0 0 13px 0 rgba(0,0,0,0.2);   }    .zero-one,    .zero-two {     position: absolute;     z-index: 8;     top: 0;     left: 17px;     box-sizing: border-box;     height: 100px;     width: 100px;     border-radius: 50%;     border: 24px solid #fff;     box-shadow: 0 0 13px 0 rgba(0,0,0,0.2);   }    .zero-two {     z-index: 6;     left: 100px;   } }  .big {   position: relative;   z-index: 20;   display: block;   font-size: 82px;   line-height: 60px;   text-transform: uppercase;   font-weight: 700;   margin-top: 6px; }  .small {   position: relative;   z-index: 20;   display: block;    font-size: 23px;   line-height: 20px;   text-transform: uppercase;   font-weight: 700;   letter-spacing: .04em; } 
Enter fullscreen mode Exit fullscreen mode

EXPLANATION

  • The .frame selector applies styles to the div element with the class of frame. This is the outermost container of the challenge.

    • The position: absolute property positions the element relative to its closest positioned ancestor, which in this case is the body element.
    • The top: 50% and left: 50% properties move the element to the center of its parent element.
    • The width: 400px and height: 400px properties set the size of the element to 400 pixels by 400 pixels.
    • The margin-top: -200px and margin-left: -200px properties offset the element by half of its width and height, so that it is exactly centered in the viewport.
    • The border-radius: 2px property rounds the corners of the element slightly.
    • The box-shadow: 1px 2px 10px 0px rgba(0,0,0,0.3) property adds a subtle shadow to the element, giving it some depth.
    • The background property sets the background color of the element to a gradient that goes from purple (#43389F) to turquoise (#4ec6ca) diagonally. The different prefixes (-webkit-, -moz-, -o-, and no prefix) are used to ensure compatibility with different browsers. The filter property is used for Internet Explorer.
    • The font-family, color, -webkit-font-smoothing, and -moz-osx-font-smoothing properties set the font and color of the text inside the element, and make it look smoother on different screens.
  • The .center selector applies styles to the div element with the class of center. This is the inner container of the challenge that holds the number and the text.

    • The position: absolute property positions the element relative to its closest positioned ancestor, which in this case is the frame div.
    • The top: 50.8% and left: 50.5% properties move the element slightly below and to the right of the center of its parent element. This is done to create a visual balance with the number and the text.
    • The transform: translate(-50%,-50%) property shifts the element by half of its width and height, so that it is centered in its parent element.
  • The .number selector applies styles to the div element with the class of number. This is the container that holds the two digits of the number “100”.

    • The position: relative property positions the element relative to its normal position in the document flow.
    • The height: 100px and width: 200px properties set the size of the element to 100 pixels by 200 pixels.
  • The .one-one, .one-two, .zero-one, and .zero-two selectors apply styles to the div elements with these classes. These are the elements that create the shapes of the digits “1” and “0”.

    • The position: absolute property positions each element relative to its closest positioned ancestor, which in this case is the number div.
    • The z-index property sets the stacking order of each element, so that some elements appear above or below others.
    • The top, left, height, width, and border-radius properties set the position and size of each element, and round their corners if needed.
    • The background or border properties set the color of each element, using white (#fff) for consistency.
    • The transform: rotate() property rotates some elements by a certain degree, to create an angle or a curve.
    • The box-shadow property adds a shadow to each element, giving them some depth.
  • The .big selector applies styles to the span element with the class of big. This is the text that says “Day 001”.

    • The position: relative property positions the element relative to its normal position in the document flow.
    • The z-index: 20 property sets a high stacking order for this element, so that it appears above all other elements in its parent container.
    • The display: block property makes this element behave like a block-level element, taking up its own line.
    • The font-size: 82px, line-height: 60px, text-transform: uppercase, and font-weight: 700 properties set the size, spacing, and weight of the text, making it look bold and capitalized.
    • The margin-top: 6px property adds some space above this element, creating a gap between it and the previous element.
  • The .small selector applies styles to the span element with the class of small. This is the text that says “CSS Challenge”.

    • The position: relative property positions the element relative to its normal position in the document flow.
    • The z-index: 20 property sets a high stacking order for this element, so that it appears above all other elements in its parent container.
    • The display: block property makes this element behave like a block-level element, taking up its own line.
    • The font-size: 23px, line-height: 20px, text-transform: uppercase, and font-weight: 700 properties set the size, spacing, and weight of the text, making it look bold and capitalized.
    • The letter-spacing: .04em property adds some extra space between each letter, making the text more readable.

CREDITS:
“Bing, a chat mode of Microsoft Bing search, helped me create this post. Bing can speak different languages, generate various content, and answer questions in depth.

This code is based on the 100 days CSS , a website with daily CSS tasks for all levels. Learn more and see other solutions here. Follow them on Twitter, Facebook, or Instagram for updates and community.”

100daysofcsscsshtmlwebdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 1k
  • Popular
  • Answers
  • Author

    How to ensure that all the routes on my Symfony ...

    • 0 Answers
  • Author

    Insights into Forms in Flask

    • 0 Answers
  • Author

    Kick Start Your Next Project With Holo Theme

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.