0

「New」と「Here is News」。それらは水平方向に同じ配置にはなりません。どうすればそれらを同じ行に入れることができますか?

ここにデモがありますhttp://jsfiddle.net/CtCuk/2/

ここに画像の説明を入力

HTML

<div class="top_page">
    <div class='container-general'>
        <div class="annouce-row">    
            <div class='title'>
                New
            </div>
            <div class='annoucement'>
                Here is News
            </div>
        </div>
    </div>
</div>

CSS

.top_page{
    text-align: center;
    width: auto;
    max-width: 900px;
    margin: 50px auto 20px;
}

.annouce-row{
    width: 800px;
}

.title {
    padding: 20px 10px;
    background-color: rgb(123, 0, 218);
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    margin: 1px;
    color: rgb(255, 255, 255);
    font-size: 22px;
    width: 70px;
}

.announcement {
    font-size: 24px;
    font-weight: 200;
    color: rgb(0, 174, 218);
    margin-left: 0px;
    width: 600px;
}
4

3 に答える 3

3
.annouce-row div {
    width: 100px;
   display: inline-block;
}

http://jsfiddle.net/CtCuk/6/

于 2013-01-28T15:56:24.713 に答える
1

float:left; css プロパティに: を入れようとしました か?ここに画像の説明を入力

于 2013-01-28T15:53:28.917 に答える
1
.annouce-row
{
     overflow:hidden;
}
.title
{
    float:left;
}
.annoucement
{
    float:left;
    margin-left:10px;
    margin-top:20px; //Change this as much as it suits you
}

.announceclassのdiv はありません.annoucement。これをチェックしてくださいhttp://jsfiddle.net/AliBassam/cqh49/

于 2013-01-28T15:52:38.043 に答える