我应该在HTML中使用%或'px' [英] Should I use % or 'px' in HTML

查看:224
本文介绍了我应该在HTML中使用%或'px'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论是HTML,XHTML还是HTML5,你都会发现这些令人讨厌的百分比在整个地方。然而...我看到很多网站不敢靠近他们。然而我总是鼓励通过uni使用它们。

Regardless of whether it is HTML, XHTML or HTML5 you find those annoying percentages littered throughout the place. Yet... I see an awful lot of websites dare not go near them. Yet I was always encouraged through uni to use them.

那么我应该使用哪个?这将导致更好的网站设计和为什么?

So which should I be using? Which would lead to better site design and why?

我知道避免使用高度,虽然HTML5真的不喜欢我不指定高度,如果我想使用百分比。

I'm aware to avoid the use of height although HTML5 really doesn't like me not specifying height if I want to use percentages.

感谢您花时间阅读。

推荐答案

这取决于你想要建立什么。

有时我需要构建一个可以被某些残疾人阅读的网站。例如,如果老年人访问您的网站,它很好使用%,以便他们可以放大你的页面,布局仍然看起来漂亮。

It really depends on what you do you want to build up.
Sometimes I need to build a website which could be read by people with certain disabilities. If for example also older people visit your site its good to use % so that they could zoom in your page and the layout still looks pretty.


固定设计版式固定设计布局具有特定宽度,并且
不能缩放以适应浏览器窗口。使用它的网站可以根据需要将
对齐到左边,中间或者对齐到右边和

Fixed Design Layouts Fixed design layouts have a specific width and do not scale to fit the browser window. Websites that make use of it can be aligned to the left, centre or even aligned to the right as and when required.

固定布局的优点:使用固定的设计布局,您可以控制
在线长度,元素在web
页面的流动和位置。设计师有一个固定的空间工作,并且文本的行长度
和图像的放置可以很容易地指定。

Benefits of Fixed layouts: With fixed design layouts you have control over the line length, flow and placement of the elements on the web page. The designer has a fixed space to work with and the line lengths of the text and the placement of images can be designated easily.

固定版面:固定设计版面在高画面
分辨率下,在设计的任一侧留下大量
空白空间。

Drawbacks of Fixed layouts: Fixed design layouts tend to leave lots of empty space on either side of the design when viewed on high screen resolutions. This dwarfs the size of the web page and gives an impression that it is floating on the screen.

流体布局流体设计布局使用百分比而不是像素到
定义它们的宽度,它们填充整个浏览器窗口。它们是
,也称为固定或动态设计。

Fluid Layout Fluid design layouts use percentages instead of pixels to define their width and they fill the entire browser window. They are also called fixed or dynamic designs.

流体布局的优点:流体设计的主要优点之一
布局是他们的辅助功能。它们满足更多的
用户。这是因为,无论可能是屏幕分辨率或用户的
设备,固定设计布局都更好地适应。它通过展开使用
整个浏览器窗口。这使得用于显示的内容的区域
最大化,并且可以在一个
go处看到更多的信息。因此,在窗口屏幕上没有空白。这是一个
更好的赌注相比固定布局,留下大量的
空白空间。

Benefits of Fluid layouts: One of the major benefits of fluid design layouts is their accessibility features. They cater to more number of users. This is because, whatever may be the screen resolution or device of the user, fixed design layouts adapt better. It makes use of the entire browser window by spreading out. This maximizes the area for the content to e displayed and more information can be seen at one go. Therefore, there is no empty space on the window screen. This is a better bet as compared to fixed layouts that leave a great deal of empty space.

这篇关于我应该在HTML中使用%或'px'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆