Giter VIP home page Giter VIP logo

colmaracademy's Introduction

Setting up my Git Repository

  1. Instructions to set up my local folder to GitHub.

    echo "# colmaracademy" >> README.md
    git init
    git add README.md
    git commit -m "first commit"
    git branch -M main
    git remote add origin https://github.com/Liyyy9/colmaracademy.git
    git remote -v
    git push -u origin main
    
  2. In the event that the URL repo is set wrongly, use the following command to set the correct url:

    
    git remote set-url origin https://github.com/thinktinker/colmaracademy.git
    git remote -v
    git push
    
    

CSS Explanation

1. RESETTING AT THE START OF THE CSS CODE

* {
    margin: 0px;
    padding: 0px;
    box-sizing: border-box;
}

Explanation:

  • (*) Universal Selector: Targets every element on the page.

  • margin: 0px: Sets the space outside of every element to zero, removing default margins that browsers might apply.

  • padding: 0px: Sets the space inside every element to zero, removing default padding.

  • box-sizing: border-box: Ensures that the width and height you set for an element include its padding and border. This means if you set an element to be 100px wide, it will be 100px wide including any padding and borders, making layout and sizing more predictable.

So, this CSS rule is useful for creating a consistent starting point for styling by eliminating extra space and making size calculations straightforward.

2. IMPORTANT NOTE ON CSS SPECIFICITY

Universal selector (*) targets every element (regardless tag, class, ID) If pseudo class :root is used, :root takes priority over html When applied, font size of 5px takes priority over that of html Here, html selector takes priority as root element over universal selector

    *{
        margin: 0;
        padding: 0;
    }

    /* :root{ font-size: 5px; } */

    html, body{
        box-sizing: border-box;
        font-family: "Lato", sans-serif;
        font-size: 16px;
    }

3. MEDIA QUERY

Media Query

@media screen and (max-width: 40rem) {
  /* CSS rules here */
}

What it does: This applies the styles inside it only when the screen width is 40rem (about 640px) or smaller.

Inside the Media Query

.mobile-nav:

.mobile-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 4rem;
}

Makes .mobile-nav visible: It uses Flexbox to center items and distribute space evenly. It also sets a height of 4rem for this element.

.desktop-nav:

.desktop-nav {
  display: none;
}

Hides .desktop-nav: It removes .desktop-nav from view when the screen is 40rem or less.

Summary

When the screen is small (640px or less), the .mobile-nav becomes visible and is styled to fit well, while the .desktop-nav is hidden.

colmaracademy's People

Contributors

liyyy9 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.