0

私は単純な HTML、CSS のデザインに取り組んでいました。助けが必要です。
下部にパディングが必要ですが、パディングを追加する必要がある場所に行き詰まっています。

PS: 下部にある JSFiddle リンク。

HTML コード

<div id="note1" class="notes-note">

    <div id="toolbar1" class="notes-toolbar">
        <div class="notes-title">Title</div>
    </div>
    <div id="content1" class="notes-content">
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    </div>

</div>

CSS

/* Notes */
.notes-note {
    width: 175px;
    height: 100px;
    margin: 5px;
    background-color: #FFFDD0;
    overflow: hidden;
}

/* Toolbar */
.notes-note .notes-toolbar {
    background-color: #E6E4BC;
    height: 20px;
    padding: 6px;
}

/* Title on the Toolbar */
.notes-note .notes-toolbar .notes-title {
    float: left;
    font-weight: bold;
    overflow: hidden;
}

/* Notes Content */
.notes-note .notes-content {
    overflow: hidden;
    font-size: 0.9em;
    margin: 10px;
}

ここにJSFiddleへのリンクがあります
JSFiddleリンク

EDIT テキストの長さはさまざまで、「note1DIV 要素のサイズも変更できます。したがって、これで私を助ける解決策は大歓迎です。

4

4 に答える 4

3

単純な解決策は、下に境界線を置くことです

http://jsfiddle.net/davidja/ZteLW/6/

.notes-note {
width: 175px;
height: 100px;
margin: 5px;
background-color: #FFFDD0;
overflow: hidden;
border-bottom: solid 10px #fffdd0; // Add This
}

または、リスター氏が指摘したように、透明な境界線を使用できます。ただし、ボックス内に境界線を配置するには、css box-sizing を使用する必要があります - http://jsfiddle.net/davidja/ZteLW/10/

.notes-note {
width: 175px;
height: 100px;
margin: 5px;
background-color: #FFFDD0;
overflow: hidden;
border-bottom: solid 10px transparent;   //add this
box-sizing : border-box ; //add this   
}
于 2013-06-27T09:07:22.753 に答える
0

idコンテンツに渡す

#content1{
   padding:5px 5px 5px 5px;
}

またはクラスノートコンテンツ

.notes-content{
   padding:5px 5px 5px 5px;
   // top right bottom left
}
于 2013-06-27T09:08:13.837 に答える
0

.notes-note クラスをコンテナーにラップして、コンテナーの下部にパディングを付けたいと思うかもしれません。

.container
{
   background: #fffdd0;
   padding-bottom: 10px;  
   width: 175px;   
}

フィドル

また、最初にテキストが切り取られないように、.notes-note クラスの高さに数ピクセルを追加しました。

于 2013-06-27T09:17:18.493 に答える