当文本在浏览器中缩放时是否允许图像缩放
我正在开发一个个人网站,主要目的是练习良好的网络开发技能。我正在尝试构建一个跨浏览器(大多数现代浏览器还有 IE6),也希望构建一个跨设备(试图在移动设备中保持相同)网页。我想要构建的是一个带有页眉和页脚的 3 列浮动布局设计。 到目前为止,我已经找到了一些好的做法..如果您有其他感觉,请纠正我..
首先也是最重要的是保持结构(HTML),表示(CSS)和行为(JS)相互排斥。 对于可扩展性,最好的选择似乎是 %units over em 单位 来开始新行
避免使用不必要的 div,最好使用标签 最好不要使用边距进行样式设置,需要时使用填充
现在我的问题是我的网页中有一个图像。到目前为止我只使用了 %units 但如果我使用 %unit 来表示图像的宽度,它将无法缩放。我可以在我的所有网页中使用 em 单位,并通过在 css 中以 em 单位设置图像的宽度来使图像保持可缩放性。
但在我这样做之前,我想知道让图像缩放是否是一个好的做法,以及我们在这种设计中面临的问题是什么。
谢谢 非常感谢有关此想法的任何建议或信息。
I am working on a personal website with more of an intention to practice good web development skills than anything. I am trying to build a cross browser( most of the modern browsers also IE6 ) and also hopefully a cross device ( trying to keep it the same in mobile devices ) web page. What i want to build is a 3 column floating layout design with header and footer.
Until now i have figured out a few good practices.. please correct me if you feel otherwise..
First and foremost is to keep the structure(HTML), presentation(CSS) and behaviour(JS) mutually exclusive.
For scalability the best option seems to be %units over em units
Avoid using div's unnecessarily, to start a new line better use
tags
Best not to use margin for styling, when needed use padding
Now my issue is i have an image in my webpage. I have used only %units till now But if i use the %unit for the width of the image it wont be scalable. I can use em units for all of my web page and leave the image also scalable by setting its width in em units in my css.
But before i do that i wanted to know if its a good practice to let images scale, and also what will be the issues we face with such a design.
Thank you
Any suggestion or information on this idea is greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
用户可以使用浏览器的缩放功能来缩放整个网站(包括图像)。文本缩放功能仅用于缩放文本 - 我建议不要修改预期行为。
Users can employ their browser's Zoom function to scale the site as a whole (including images). The text scaling function is meant only for scaling text - I'd advise against modifying the expected behavior.