当前位置: 首页 > news >正文

知名小蚁人网站建设中国房地产排名100强

知名小蚁人网站建设,中国房地产排名100强,做网站相关的英文名词,免费咨询骨科医生回答在线我有body {background: url(images/background.svg);}期望的效果是该背景图像的宽度等于页面的宽度#xff0c;高度变化以保持比例。 例如 如果原始图像恰好是100 * 200(任何单位)且正文宽度为600px#xff0c;则背景图像最终应为1200px高。 如果调整窗口大小#xff0c;高度…我有body {background: url(images/background.svg);}期望的效果是该背景图像的宽度等于页面的宽度高度变化以保持比例。 例如 如果原始图像恰好是100 * 200(任何单位)且正文宽度为600px则背景图像最终应为1200px高。 如果调整窗口大小高度应自动更改。 这可能吗目前Firefox看起来正在调整高度然后调整宽度。 这可能是因为高度是最长的尺寸而且它试图避免裁剪 我想垂直裁剪然后滚动没有水平重复。此外即使明确指定background-repeat:repeatChrome也会将图像置于中心位置不会重复无论如何都是默认值。html, body { height: 100%; }有帮助吗 还有咳嗽。这有一个CSS3属性即background-size(兼容性检查)。虽然可以设置长度值但它通常与特殊值contain和cover一起使用。在您的特定情况下您应该使用coverbody {background-image:    url(images/background.svg);background-size:     cover;                      /* background-repeat:   no-repeat;background-position: center center;              /* optional, center the image */}eggplanation为contain和cover对不起的双关语感到抱歉但我将使用Biswarup Ganguly当天的照片进行演示。让我们说这是你的屏幕灰色区域在你的可见屏幕之外。为了演示我将假设一个16x9的比例。我们想用上面提到的图片作为背景。但是出于某种原因我们将图像裁剪为4x3。我们可以将background-size属性设置为某个固定长度但我们将关注contain和cover。请注意我还假设我们没有破坏body的宽度和/或高度。containcontainScale the image, while preserving its intrinsic aspect ratio (if any), to the largest size such that both its width and its height can fit inside the background positioning area.这样可以确保背景图像始终完全包含在背景定位区域中但是在这种情况下可能会有一些空白空间填充background-colorcovercoverScale the image, while preserving its intrinsic aspect ratio (if any), to the smallest size such that both its width and its height can completely cover the background positioning area.这可以确保背景图像覆盖所有内容。没有可见的background-color但是根据屏幕的比例图像的很大一部分可能会被切断用实际代码演示div div {background-image: url(http://i.stack.imgur.com/r5CAq.jpg);background-repeat: no-repeat;background-position: center center;background-color: #ccc;border: 1px solid;width: 20em;height: 10em;}div.contain {background-size: contain;}div.cover {background-size: cover;}/********************************************Additional styles for the explanation boxes*********************************************/div div {margin: 0 1ex 1ex 0;float: left;}div div {clear: both;border-top: 1px dashed silver;padding-top:1ex;}div div::after {background-color: #000;color: #fefefe;margin: 1ex;padding: 1ex;opacity: 0.8;display: block;width: 10ex;font-size: 0.7em;content: attr(class);}Note the grey background. The image does not cover the whole region, but its fully contained.Note the ducks/geese at the bottom of the image. Most of the water is cut, as well as a part of the sky. You dont see the complete image anymore, but neither do you see any background color; the image covers all of the .这正是我想要的谢谢。它似乎不适用于Chrome(或至少Chromium) - 有任何好主意吗根据quirksmode.org/css/contents.html#t44它应该在Chrome中工作没有任何前缀。但是您尝试过-webkit-前缀吗Yauhen的答案(在本页底部)实际上是我在寻找的background-size: containDannyBeckett虽然这是可能的但它不是OP想要的我想垂直裁剪然后滚动没有水平重复。DannyBeckett新版本现在应涵盖所有相关问题。毕竟我之前的回答是相当微小的。contain就像缩放适合。 cover就像缩放填充。 contain调整图像大小以匹配宽度和高度之间的较大尺寸。 cover调整图像大小以匹配宽度和高度之间的较小尺寸。Zeta抱歉我的错误我混淆了两个边框蓝色和红色边框。基于来自https://developer.mozilla.org/en-US/docs/CSS/background-size的提示我最终得到了以下对我有用的配方body {overflow-y: hidden ! important;overflow-x: hidden ! important;background-color: #f8f8f8;background-image: url(index.png);/*background-size: cover;*/background-size: contain;background-repeat: no-repeat;background-position: right;}虽然我使用background-position: center;但这对我来说比backgound-size: cover;更好。我可以知道为什么我们需要overflow-y: hidden部分吗我不确定你到底在寻找什么但是你真的应该看看Chris Coyier写的CSS-Tricks的这些优秀博客文章阅读每篇文章的描述看看它们是否符合您的要求。第一个回答了以下问题Is there a way to make a background image resizeable? As in, fill the background of a web page edge-to-edge with an image, no matter the size of the browser window. Also, have it resize larger or smaller as the browser window changes. Also, make sure it retains its ratio (doesnt stretch weird). Also, doesnt cause scrollbars, just cuts off vertically if it needs to. Also, comes in on the page as an inline tag.第二篇文章的目标是获得以下内容网站上的背景图像始终覆盖整个浏览器窗口。希望这可以帮助。试试这个element.style {background: rgba(0, 0, 0, 0) url(img/shopping_bgImg.jpg) no-repeat scroll center center / cover;}背景图像不是设置完美然后他的CSS是问题创建所以他的CSS文件更改为下面的代码html {background-image: url(example.png);background-repeat: no-repeat;background-position: 0% 0%;background-size: 100% 100%;}; background-size100100;只需添加以下一行.your-class {height: 100vh;}vh是视口高度。这将自动缩放以适合设备的浏览器窗口。在这里查看更多使div为浏览器窗口的100高度body{background-image: url(../url/imageName.jpg);background-attachment: fixed;background-size: auto 100%;background-position: center;}描述问题究竟是什么以及如何解决它请不要在没有解释的情况下粘贴一堆代码。我遇到了同样的问题在调整浏览器尺寸时无法调整图像大小。坏代码html {background-color: white;background-image: url(example.png);background-repeat: no-repeat;background-attachment: scroll;background-position: 0% 0%;}好代码html {background-color: white;background-image: url(example.png);background-repeat: no-repeat;background-attachment: scroll;background-position: 0% 0%;background-size: contain;}这里的关键是添加这个元素 - background-sizecontains;这对我有用background-size: auto 100%;设置背景大小没有帮助以下解决方案对我有用.class {background-image: url(blablabla.jpg);/* Add this */height: auto;}它基本上会裁剪图像并使其适合background-size: contain/cover仍然不适合。
http://www.yutouwan.com/news/44359/

相关文章:

  • 漳州微网站建设公司怎样下载软件到电脑桌面上
  • 网站要怎么做才专业小视频做网站怎么赚钱
  • 白酒公司网站的建设吉林网络推广代运营
  • 响应式制作网站建设免备案空间免费
  • 网站代码优化视频教程贾汪网站建设
  • 关键词搜索引擎网站wordpress 设置版权
  • 深圳大型网站建设网站seo 工具
  • 协同办公oa沈阳seo按天计费
  • 网站开发职位百度手机seo软件
  • app大全软件网站免费下载排名优化网站
  • 做网站手机端需要pc端的源代码吗烦恼可以做网站吗
  • 北京网站制作建设公司哪家好电脑编程学校哪家好
  • 坑梓网站建设市场微网站开发一般费用多少钱
  • 广州网捷网站建设技术有限公司有什么做C语言的网站
  • 陕西省建设执业注册中心网站一分钟做网站
  • 深圳专业网站建设公司排名谷德设计网app
  • wordpress搭建下载站点丰台网站开发联系电话
  • ppt链接网页怎么制作宁波seo费用
  • 网站建设科技有限公司中国空间站建造完成
  • 无需下载国外黄冈网站推广在线代理访问网站的网址
  • 哪里有网站建设企业怎么申请自己的小程序
  • 开发东莞网站制作公司如何拥有一个免费的企业邮箱
  • 网站推广的渠道开发必备软件
  • 通过服务推广网站东莞详情页设计
  • wordpress建企业站电商网站成品案例
  • 高端网站制作系统高端品牌女装连衣裙
  • 如何开发一个app建设一个网站学校建设外文网站情况
  • 做网站广告语网站开发有什么好的论坛
  • 电商网站开发重难点中国建筑业网
  • 门户网站建设项目外贸营销主题怎么写