且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我应该在HTML中使用%或'px'

更新时间:2023-11-09 23:04:22

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

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

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.