Giter Site home page Giter Site logo

40-layout-exercises's Introduction

40 Layout Exercises

GitHub license

Intro:

This layout exercise is created by @byr-gdp , this is an English vrsion translated by me.

All exercises based on the following HTML structure (do not change the HTML structure, or it will lose the meaning of practice), all you need to do is to add css code in layout area to change the layout of the page.

HTML:

<div id="container">
	<div id="header">Header</div>
	<div id="wrapper">
		<div id="content">Content</div>
	</div>
	<div id="navigation">Navigation</div>
	<div id="extra">Extra stuff</div>
	<div id="footer">Footer</div>
</div>

CSS:

/*basic style*/
#container { 
    font-size: 12px; 
    font-family: arial, sans-serif;
}
p { 
    margin: 0 10px 10px;
}
#header {
    height: 80px; 
    background-color: rgb(238,238,238); 
    color: rgb(122,177,36); 
    padding-left: 10px; 
    line-height: 80px; }
#header h1 {
    margin: 0;
}
#navigation {
    background-color: rgb(186,203,253);
}
#extra {
    background-color: rgb(253,133,67);
}
#footer {
    height: 14px;  
    padding:5px 10px 5px 10px; 
    color: #FFF; 
    background-color: #333;
}
#footer p {
    line-height: 14px; 
    margin: 0px;
}

/* layout */

Exercises

1.Three percentage columns(n.1)

There are three elements: wrapper, navigation and extra

Guide:

  1. Set the width of wrapper to 50% and horizontally center the wrapper element.
  2. Set width of navigation and extra to 25%, navigation on the left side of wrapper, extra on the right.

Example:

image

2. Three percentage columns(n.2)

Guide:

  1. Exchanges positions of navigation and extra on the basis of exercise 1.

Example:

image

3.Three percentage columns(n.3)

There are three elements: content, navigation and extra

Guide:

  1. Set the wrapper aligned left and width to 50%,
  2. Set width of navigation, extra to 25%,arrange them on the right side of content in order.

Example:

image

4. Three percentage columns(n.4)

Guide:

  1. Exchanges positions of navigation and extra on the basis of exercise 2.

Example:

image

40-layout-exercises's People

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.