gpt4 book ai didi

html - CSS 缩放属性在 FF 中的行为不同

转载 作者:行者123 更新时间:2023-11-28 13:35:23 25 4
gpt4 key购买 nike

我想制作一个始终适合 100% 屏幕并与中心对齐的 slider ,无论分辨率如何。我想用 zoom 属性来做,然后用 Javascript 改变它。

到目前为止我编写了这个

CSS:

#wrapper-slider{position:absolute;width:100%;height:100%;top:0;left:0;z-index:7;display:block;  -moz-transform: scale(0.3); zoom:30%; -moz-transform-origin:0 0;}       
#container-slider {background:url('http://i48.tinypic.com/znpwm0.jpg') no-repeat; width:967px; height:800px; margin: 0 auto; text-align:center; display: block; position: relative;}
#wrapper-slider .img {position:absolute;display:black;z-index:8;height:486px;width:758px; padding-left: 101px; padding-top: 94px; margin:0 auto; text-align: center;}
#wrapper-slider .img img {max-height: 487px; max-width:758px; margin:0 auto; display: block;}
#container-slider p {position: absolute; z-index: 20; color:#000000;}
#container-slider strong { line-height: 21px;}
#container-slider .add-to-basket {left:109px; bottom:24px;}
#container-slider .add-to-basket a {display: block; width:142px; height:36px; font-size:14px; font-weight:bold; text-align:center; color: black;line-height: 34px;}
#container-slider .description {right: 112px; bottom:17px; width: 361px; height:76px; text-align:center; font-size:15px;}
#container-slider .details {right:492px; bottom:17px; width:188px; height:76px; text-align:center; font-size:15px;}
#container-slider .price {left:109px; bottom:72px; width:142px; text-align:center; font-size:24px; color: #FF6C00;}
#container-slider .left{left:395px;}
#container-slider .right{right:401px;}
#container-slider .arrow{width:80px; height: 80px; display:block; bottom:120px; position:absolute;z-index:10; text-indent: -10000000px;}
#container-slider .close{width:70px; height: 70px; display:block; top:25px; right:40px; position:absolute;z-index:10; text-indent: -10000000px;}
#container-black{position:absolute;width:100%;height:100%;top:0;left:0;background:#000;z-index:6;}​

HTML:

<div id="wrapper-slider">
<div id="container-slider">
<a class="close" href="#" title="Zamknij podgląd">close</a>

<div class="img">
<img class="main" src="http://asset0.cbsistatic.com/cnwk.1d/i/tim/2012/08/15/35414204_620x433.jpg"/>
</div>

<a class="arrow left" title="Poprzedni produkt" href="#">Left</a>
<a class="arrow right" title="Następny produkt" href="#">Right</a>

<p class="price">390.00 PLN</p>
<p class="add-to-basket"><a href="#">Dodaj do koszyka</a></p>

<p class="details">
<strong>Wymiary:</strong><br>
100 x 50 cm<br>
<strong>Technika:</strong><br>
Rysunek
</p>

<p class="description" title="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. ">
<strong>Opis:</strong><br>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy t...
</p>
</div>

</div>
<div id="container-black"></div>

此代码在 jsfiddle.net 中有效:http://jsfiddle.net/MjmDT/1/

它在 chrome 中完美运行,但在 FF 和 IE 中它向左对齐。我不知道如何修复它。

最佳答案

没有名为 zoom 的 CSS 属性。这是 CSS 的专有 MS IE 扩展(如 hasLayout 标志)。

此外,Firefox 允许设置缩放时发生的情况:是否应该放大整个页面,包括任何图像(任何当前浏览器版本的默认设置)。或者在缩放页面时应该只增加文本大小。检查您的 Fx 设置:“查看”->“缩放”(或类似的,我安装了德语版本)。

关于html - CSS 缩放属性在 FF 中的行为不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13053247/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com