What is a pixel (px) in CSS?

前端 未结 7 1953
粉色の甜心
粉色の甜心 2021-02-19 01:33

I am reading an ASP.NET book and it refers to CSS files and talks about pixels. But I never understood it from a resolution, layout, etc. point of view. For example, what does t

7条回答
  •  生来不讨喜
    2021-02-19 02:18

    As stated by others, a pixel is simply a measurable unit that relates directly to the electronic display of data - a single pixel is the smallest an object on screen can be. The greater the screen resolution, the more pixels it can represent.

    A note on the example given - a value of 0px is actually unnecessary as a zero value, and is better represented in CSS as just a 0 (it could equally be 0% or 0em, they all mean the same).

提交回复
热议问题