Div width in cm (inch)

后端 未结 6 2144
予麋鹿
予麋鹿 2020-11-30 06:22

I need to put in my site div which is exactly 25cm width ( 10 inch) in every display. How I can do it ?

6条回答
  •  旧巷少年郎
    2020-11-30 07:12

    You can simply use the cm unit in CSS:

    #mydiv { width: 25cm; }
    

    Note that, as others pointed out, the result still depends on the correct reading of the monitor size by the operating system.

    See the spec for more information.

提交回复
热议问题