Giter Club home page Giter Club logo

css-layout-challenges's Introduction

title length tags
CSS Layout Challenge
css, layout, positioning

CSS Layout Challenge

As a front end developer, you will often be handed comps from a designer that you then have to build. You will need to be able to take a graphic file and recreate it with code. This means that you'll have to be able to think through how you're going to get all the elements in that comp where they need to be, and that requires a solid understanding of how to position HTML elements with CSS.

Getting Started

In this exercise, we'll take a series of simple comps and recreate each in CodePen. You will make the appropriate number of <div> tags with the div numbers indicated in the comps, give them a <height>, <width>, and background-color and then make them match the layout in the comp. Here's an example of what this might look like in your HTML and CSS:

Your HTML:

<div class="div1">
  div1
</div>

<div class="div2">
  div2
</div>

Your CSS:

div {
  width: 100px;
  height: 100px;
  background-color: black;
  color: white;
}
.div1 {
  float: right;
}

.div2 {
  float: left;
}

Challenge Deliverables

When you have completed all the layout challenges and saved a pen for each, make a gist with links to all your CodePen solutions (also called 'pens'). In your gist include the challenge number, and a brief explanation of the approach/thinking you used to solve each layout challenge. The structure of your gist content should be written in Markdown, a simple text formatting syntax that you can use when you write a gist. Here's an example of what the structure of your gist should look like:

##### Challenge Number // this is an h5 title in Markdown
Description of approach // this is a paragraph is Markdown
[Challenge number](link to code pen here) // this is a link in Markdown.

Example:

##### Challenge 5

I used these elements and specified these styles to make this thing happen. I chose to use white text color because you can't see it if it's black. (duh). (When you write this make your actual description more meaningful...)

[Challenge 5](http://www.google.com)

Which will come out looking like this in your gist:

Challenge 5

I used these elements and specified these styles to make this thing happen. I chose to use white text color because you can't see it if it's black. (duh). (When you write this make your actual description more meaningful...)

Challenge 5

Submitting Your CSS Challenges

Here is a gist to use as a template for your own gist.

When you have completed your own gist with descriptions and links to your pens, put the link to your gist in the comments of the above template gist.

Tips:

  • Remember, we've talked about several ways to position elements on the page. These include but are not necessarily limited to display: block and display: inline-block, position: relative and position: absolute, margin, padding, and the infamous float.
  • If the layout dictates, some of the divs may be nested within other divs. Use your best judgement!
  • See how many different ways you can achieve the same result and consider the pros/cons of solution!

The Comps

Challenge 1:

challenge 1

Challenge 2:

challenge 2

Challenge 3:

challenge 3

Challenge 4:

challenge 4

Challenge 5:

challenge 5

Challenge 6:

challenge 6

Challenge 7:

challenge 7

Challenge 8:

challenge 8

Challenge 9:

challenge 9

Challenge 10:

challenge 10

Challenge 11:

challenge 11

Challenge 12:

challenge 12

Challenge 13:

challenge 13

Challenge 14:

challenge 14

Challenge 15:

challenge 15

css-layout-challenges's People

Contributors

breethomas avatar louisabarrett avatar martensonbj avatar thatpamiam 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.