猿问

怎样实现转盘随着分辨率的大小改变而高度不变

<style type="text/css">

*{

margin:0;

padding:0

}

body{

font-family:'微软雅黑','MicrosoftYaHei',Arial,Helvetica,sans-serif; color:#000; min-width:320px;width:100%;

}

.pr {

position: relative;

}

.demo {

width: 300px;

height: 417px;

position: relative;

margin: 10px auto;

left: 40px;

top: 175px

}

#disk {

width: 417px;

height: 417px;

background: url(~/image/disk.jpg) no-repeat

}

#start {

width: 163px;

height: 320px;

position: absolute;

top: 76px;

left: 95px;

}

#start img {

cursor: pointer

}

#main {

background: url(images/bj.jpg) no-repeat center top;

background-size: 100%;

height: 520px;

width: 100%

}

img {

    max-width: 100%;

    vertical-align: middle;

    border: 0px none;

}

.pic {

width: 100%;

text-align: center;

margin: 0px auto;

}

.w927 {

height: 515px;

background: url(../images/bj.jpg) no-repeat center top;

background-size: 100%;

}

.map-item{

width:100%;

text-align:left;

padding:3% 7%;

color:#20436b;

font-size:12px;

}

</style>

</head>

<body>

<div id="main">


<div class="msg"></div>

<div class="demo pr"> 

<img src="images/pan.png" alt="Big Boat" width="240">

  <div id="start"> <img src="images/zhen.png" id="startbtn" width="50"></div>

</div>

  <div class="pic">

    <img src="images/time.png">

    </div>

<div class="pic">

    <img src="images/content.jpg">

    </div>

    <div class="pic">

    <img src="images/gz.png">

    </div>


big_rock
浏览 1826回答 4
4回答

echo_kinchao

你这样写的意思 浏览器会认为是图片本身的 size固定在百分百了  应该写例如  width:80%

浅水了

是两张图吗?

echo_kinchao

高度定死    宽度设定百分比

big_rock

这种的图 不变高度
随时随地看视频慕课网APP
我要回答