Giter Club home page Giter Club logo

40layoutexercise's People

Contributors

byr-gdp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

40layoutexercise's Issues

第13个图的实现有问题

首先非常感谢您写的这个样式库,让我能有各种布局的练习,我不知道是我的方式有问题(我将您的模版进行了修改,但保留了对应的结构),按照您的样式书写是有问题的,我的推测是应为您的content中的内容较长,宽度足以撑开,否则在float为浮动的情况下,margin:0 200px并不能实现居中的效果。我觉得稳妥的情况应该是将wrapper的宽度用calc(100% - 400px)计算出来,这样的情况下无论内容多少,都可以达到居中的效果。

不知道我上面的理解是否正确,如果有什么不对的,望您指出,谢谢!
下面我放上我的代码

<!DOCTYPE html>
<html lang="zh-CN">

<meta charset="utf-8">
<title>三栏布局-浮动实现</title>
<link ref="stylesheet" href="normalize.css">

<style>
  .article {
    /* width: 700px; */
    /* margin: 0 200 0 200; */
  }

  .wrapper {
    /* width: 400px; */
    width: calc(100% - 400px);
    float: left;
    margin: 0 200px;
    background-color: yellow;
  }

  .nav {
    width: 200px;
    float: left;
    margin-left: -200px;
    background-color: red;
  }

  .aside {
    width: 200px;
    float: left;
    margin-left: -100%;
    background-color: blue;
  }

  .footer {
    clear: both;
  }
</style>

<body>
  <article class="article">
    <header class="header">Header</header>
    <div class="wrapper">
      <section>Content</section>
    </div>
    <nav class="nav">Navigation</nav>
    <aside class="aside">Extra stuff</aside>
    <footer class="footer">Footer</footer>
  </article>
</body>

第5、 7、9个图错了

  1. Three percentage columns(n.5)

要求

  1. wrapper 右对齐且占据50%宽度
  2. navigation、extra 宽度25%,依次位于content左侧

image


  1. Three fixed columns(n.7)

要求

  1. container 宽度700px且居中
  2. wrapper 居中且宽度400px
  3. extra、navigation 150px,依次位于content两侧
    image

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.