1

ここで最初の質問。幅、他のカードに対する垂直位置、およびコンテンツに対するサイズを維持する Google Now カードを取得しようとしています。このように、ウィンドウのサイズが十分に小さくなると、1 つの列に圧縮されます。

これは、3 枚目のカードが完成するまで、または 2 枚目のカードが 1 枚目のカードより多くのコンテンツを含むまで機能します。

body {
    background-color: #f1f1f3;
    margin:auto;
}
h1 { 
    color:white;
    font-family:"Roboto";
    font-weight:100;
    font-size:36px;
}
h2 {
    font-family:'Roboto';
    font-weight:100;
    font-size:30px;
    color:#212121;
}
h4 {
    font-family:'Roboto';
    font-weight:400;
    font-style: italic;
    font-size:16px;
    color: #727272;
    border-top: 1px solid #727272;
    padding-top: 4px;
}
p {
    font-family:'roboto';
    font-weight:400;
    font-size:20px;
    color:#727272;
}
.content-link {
    color:#212121;
    text-decoration: none;
    font-weight:700;
}
.card-track {
    width:100%;
    height: auto;
    position:relative;
}
.card {
    width: 466px;
    margin: 15px;
    background-color:white;
    border-radius: 4px;
    float:left;
}
.card-color {
    width:466px;
    height: 96px;
    background-color: #395a66;
    position:absolute;
    border-radius: 4px 4px 0px 0px;
}
.card-icon {
    height: 46px;
    width:46px;
    margin: 25px;
    float:left;
}

.card-icon-img {
    max-height: 48px;
    height: auto;
    -webkit-filter: invert(100%);
}
.card-content-icon-img {
    max-height: 50px;
    height: auto;
    -webkit-filter: opacity(55%);
}
.card-color-title {
    margin:27px;
}
#gamingthronebar {
    background-color:#FFC107;
}
#colorbar {
    background-color:#673AB7;
}
.card-content {
    padding:100px 30px 20px 60px;
}
.card-content-icon {
    float:left;
    width:60px;
    height:60px;
    margin:120px 0px 0px 24px;
}
<link href='http://fonts.googleapis.com/css?family=Roboto:400italic,100,700,400' rel='stylesheet' type='text/css'>
<body>
<div class="card-track">
        <!-- Card
        <div class="card">
            <span class="card-color">
                <div class="card-icon"><img class="card-icon-img" src=""></div>
                <h1 class="card-color-title"></h1>
            </span>
            <div class="card-content-icon"><img class="card-content-icon-img" src=""></div>
            <div class="card-content">
                <p></p>
                <h4></h4>
            </div>
        </div><!--End Card-->
        <div class="card">
            <span class="card-color">
                <div class="card-icon"><img class="card-icon-img" src="material-design-icons/verification24.png"></div>
                <h1 class="card-color-title">Hello, World!</h1>
            </span>
            <div class="card-content-icon"><img class="card-content-icon-img" src="material-design-icons/android11.png"></div>
            <div class="card-content">
                <p>Take a look around this site, it's designed based upon the glorious look and feel of <a class="content-link" href="http://www.google.com/design/spec/material-design/introduction.html">Material Design</a>, a visual scheme designed by Google for use with Android 5.0 Lollipop. </p>
            </div>
        </div><!--End Card-->
        <div class="card">
            <span class="card-color" id="colorbar">
                <div class="card-icon"><img class="card-icon-img" src="material-design-icons/good4.png"></div>
                <h1 class="card-color-title">No Java required</h1>
            </span>
            <div class="card-content-icon"><img class="card-content-icon-img" src="material-design-icons/painter14.png"></div>
            <div class="card-content">
                
                <h2></h2>
                <p> Check it out! Right click > "Inspect Element"</p>
                <h4>Learn More</h4>
            </div>
        </div> <!--End Card-->
        <div class="card">
            <span class="card-color" id="gamingthronebar">
                <div class="card-icon"><img class="card-icon-img" src="material-design-icons/gamingthronewhite.png"></div>
                <h1 class="card-color-title">Another cool project</h1>
            </span>
            <div class="card-content-icon"><img class="card-content-icon-img" src="material-design-icons/memory1.png"></div>
            <div class="card-content">
                <p>This is a test of the emergency broadcast system.</p>
                <h4>This is a link</h4>
            </div>
        </div><!--End Card-->
        <div class="card">
            <span class="card-color">
                <div class="card-icon"><img class="card-icon-img" src="material-design-icons/round58.png"></div>
                <h1 class="card-color-title">About the designer</h1>
            </span>
            <div class="card-content-icon"><img class="card-content-icon-img" src="material-design-icons/create3.png"></div>
            <div class="card-content">
                <p>I'm no one of consequence. But if you must know, I like Material Design. This website is a work in progress, but it's my best shot.</p>
                <h4>Professional Version</h4>
            </div>
        </div><!--End Card-->
    </div><!--End card track-->
  </body>

そして、これはかなり機能しますが、カードの高さは次の列のカードによって決定されますが、これは近いですが、カードをその上の列の高さによって決定したいと考えています。

body {
    background-color: #f1f1f3;
    margin:auto;
}
h1 { 
    color:white;
    font-family:"Roboto";
    font-weight:100;
    font-size:36px;
}
h2 {
    font-family:'Roboto';
    font-weight:100;
    font-size:30px;
    color:#212121;
}
h4 {
    font-family:'Roboto';
    font-weight:400;
    font-style: italic;
    font-size:16px;
    color: #727272;
    border-top: 1px solid #727272;
    padding-top: 4px;
}
p {
    font-family:'roboto';
    font-weight:400;
    font-size:20px;
    color:#727272;
}
.content-link {
    color:#212121;
    text-decoration: none;
    font-weight:700;
}
.card-track {
    width:100%;
    height: auto;
    position:relative;
    text-align: center;
}
.card {
    width: 466px;
    margin: 15px;
    background-color:white;
    border-radius: 4px;
    display:inline-flex;
    text-align: left;
}
.card-color {
    width:466px;
    height: 96px;
    background-color: #395a66;
    position:absolute;
    border-radius: 4px 4px 0px 0px;
}
.card-icon {
    height: 46px;
    width:46px;
    margin: 25px;
    float:left;
}

.card-icon-img {
    max-height: 48px;
    height: auto;
    -webkit-filter: invert(100%);
}
.card-content-icon-img {
    max-height: 50px;
    height: auto;
    -webkit-filter: opacity(55%);
}
.card-color-title {
    margin:27px;
}
#gamingthronebar {
    background-color:#FFC107;
}
#colorbar {
    background-color:#673AB7;
}
.card-content {
    padding:100px 30px 20px 60px;
}
.card-content-icon {
    float:left;
    width:60px;
    height:60px;
    margin:120px 0px 0px 24px;
}
<link href='http://fonts.googleapis.com/css?family=Roboto:400italic,100,700,400' rel='stylesheet' type='text/css'>
<body>
<div class="card-track">
        <!-- Card
        <div class="card">
            <span class="card-color">
                <div class="card-icon"><img class="card-icon-img" src=""></div>
                <h1 class="card-color-title"></h1>
            </span>
            <div class="card-content-icon"><img class="card-content-icon-img" src=""></div>
            <div class="card-content">
                <p></p>
                <h4></h4>
            </div>
        </div><!--End Card-->
        <div class="card">
            <span class="card-color">
                <div class="card-icon"><img class="card-icon-img" src="material-design-icons/verification24.png"></div>
                <h1 class="card-color-title">Hello, World!</h1>
            </span>
            <div class="card-content-icon"><img class="card-content-icon-img" src="material-design-icons/android11.png"></div>
            <div class="card-content">
                <p>Take a look around this site, it's designed based upon the glorious look and feel of <a class="content-link" href="http://www.google.com/design/spec/material-design/introduction.html">Material Design</a>, a visual scheme designed by Google for use with Android 5.0 Lollipop. </p>
            </div>
        </div><!--End Card-->
        <div class="card">
            <span class="card-color" id="colorbar">
                <div class="card-icon"><img class="card-icon-img" src="material-design-icons/good4.png"></div>
                <h1 class="card-color-title">No Java required</h1>
            </span>
            <div class="card-content-icon"><img class="card-content-icon-img" src="material-design-icons/painter14.png"></div>
            <div class="card-content">
                
                <h2></h2>
                <p>There was lots of java involved in the making of this website, but there's none in this website. Check it out! Right click > "Inspect Element"</p>
                <h4>Learn More</h4>
            </div>
        </div> <!--End Card-->
        <div class="card">
            <span class="card-color" id="gamingthronebar">
                <div class="card-icon"><img class="card-icon-img" src="material-design-icons/gamingthronewhite.png"></div>
                <h1 class="card-color-title">Another cool project</h1>
            </span>
            <div class="card-content-icon"><img class="card-content-icon-img" src="material-design-icons/memory1.png"></div>
            <div class="card-content">
                <p>This is a test of the emergency broadcast system.</p>
                <h4>This is a link</h4>
            </div>
        </div><!--End Card-->
        <div class="card">
            <span class="card-color">
                <div class="card-icon"><img class="card-icon-img" src="material-design-icons/round58.png"></div>
                <h1 class="card-color-title">About the designer</h1>
            </span>
            <div class="card-content-icon"><img class="card-content-icon-img" src="material-design-icons/create3.png"></div>
            <div class="card-content">
                <p>I'm no one of consequence. But if you must know, I like Material Design. This website is a work in progress, but it's my best shot.</p>
                <h4>Professional Version</h4>
            </div>
        </div><!--End Card-->
    </div><!--End card track-->
  </body>

何かご意見は?ウェブサイトには明らかにそれ以上のものがありますが、それが私が現在苦労している主なものです.

4

0 に答える 0