在右侧显示图像

时间:2016-07-13 10:07:37

标签: html css

我们的网页看起来像this link

enter image description here

我们想要显示如下图像:

enter image description here

1)减少文本see cases

的背景颜色长度

2)右侧显示图像

我可以尝试为position : relative; top: left: some px;提供所有内容。但我觉得它编码不好。所以请帮助我。

CSS

.custom_case
{
    background: #fff;
    padding: 95px;
}

.cc1
{
color: #ff7704; 
font-family: 'Roboto Condensed', sans-serif;
font-size:34px;
}

.cc2
{
color: #000000; 
text-transform: capitalize;
font-size:34px;

}


#brand_select
{
color: #000000; 
text-transform: capitalize;
font-size:17px;
font-weight:bold;
letter-spacing: 1px;
}



#model_select
{
color: #000000; 
text-transform: capitalize;
font-size:17px;
font-weight:bold;
letter-spacing: 1px;


}

.cc3 
{   
    background: #ff7704;
    position:relative;
    top:20px;   
}


.cc5
{
    font-size:20px;
    color:#FFFFFF;
}

HTML

<div class="custom_case">
    <div class="custom_case_left">
        <h1 class="cc1">Custom Cases</h1>
        <h2 class="cc2">Make Your Own design</h2>
    </div>

    <?php

    $brandSelect .= '<option value="">My Brand</option>';

    echo '<select id="model_select"><option value="">My Model</option></select>';

    ?>

    <div class ="cc3">
    <div class ="cc4">
    <a href="http://sbdev2.kidsdial.com/golden-waves-marble-texture-apple-iphone-4-phone-case.html"><span class ="cc5"> See Cases </span> </a>
    </div>

    </div>

    <div class="custom_case_right">
        <img src="<?php echo $this->getSkinUrl('images/gal.PNG'); ?>" >


        </div>

3 个答案:

答案 0 :(得分:2)

您可以将此css属性添加到代码

.custom_case_right img{
  float: right;
  }

答案 1 :(得分:1)

试试这个:

.custom_case_right {
    float: right;
    top: -200px;
    position: relative;
    right: -90px;
}

并添加.custom_case:

height:550px;

答案 2 :(得分:1)

你可以尝试这个:

 .custom_case
{
    background: #fff;
    padding: 95px;

}
.custom_case_left h1
{
  font-size:20px;
}
.custom_case_left h2
{
  font-size:20px;
}
.cc1
{
color: #ff7704; 
font-family: 'Roboto Condensed', sans-serif;
font-size:34px;
}

.cc2
{
color: #000000; 
text-transform: capitalize;
font-size:34px;

}

.cc4
{
  width:200px;
}
#brand_select
{
color: #000000; 
text-transform: capitalize;
font-size:17px;
font-weight:bold;
letter-spacing: 1px;
}



#model_select
{
color: #000000; 
text-transform: capitalize;
font-size:17px;
font-weight:bold;
letter-spacing: 1px;


}

.cc3 
{   
    background: #ff7704;
    position:relative;
    top:20px; 
    width: 148px;
}


.cc5
{
    font-size:20px;
    color:#FFFFFF;

}

.custom_case_right img {
    float: right;
    top: -150px;
    position: relative;
    right: -90px;
    width:250px;
}

UPDATED DEMO

相关问题