GithubHelp home page GithubHelp logo

css-challenges-2's Introduction

CSS Challenges 2

Follow the comments in the challenge file.

Open the work in your web browser make changes and refresh the browser to see the effect of each change as you work.

It's important to see the effect of each change you make!

Pro tip! Install the Live Server extension for your code editor. This will allow you to open the web page from your code editor and automatically refresh the browser when your save your files.

Flex

Flex is a property when applied to an element arranges the children of the element. For example:

<ul>
	<li></li>
	<li></li>
	<li></li>
</ul>

Look at the HTML above. The CSS below arranges the li tags. Notice the selector is the ul which is the parent.

ul {
	display: flex;
}

You apply Flex to the parent and it arranges the children. In the example above, applying flex to the ul would arrange the child li tags!

The challenge code will walk you through how to apply flex. Be sure to watch for changes to the web page in the browser as you edit the CSS.

Play with the challeneges then review the links below for information and explore the features of flex box.

CSS Units

Units are important to CSS. Almost every numeric value requires that you include a unit. Here is a list of some of the units available in CSS:

  • in - inches
  • mm - millimeters
  • cm - centimeters
  • px - pixels

These units should be pretty familiar. Inches, millimeters, and centimeters should be easy to picture. Pixels migth be harder. In the early days of computers there were 72 pixels to an inch. That is a pixel was 1/72 of an inch in size.

Now days screen sizes are more varied and pixels come in different sizes. In CSS a pixel is still considered 1/72 of an inch.

There are also a few more units that important to CSS. These are not as obvious.

  • em
  • rem

An em is a measurement based on typography. If the font size for an element is set to 16px then 1em is 16px and 2em would be 32px, or 1.5em would be 24px.

A rem is the same as an em but refers to the root element, rem === root em.

https://alligator.io/css/rem-vs-em-units/ https://css-tricks.com/confused-rem-em/ https://zellwk.com/blog/rem-vs-em/

Colors

Colors are important. You'll use them everywhere. They key part of experssion.

css-challenges-2's People

Contributors

soggybag 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.