Discuz! Board

 找回密碼
 立即註冊
搜索
熱搜: 活動 交友 discuz
查看: 3|回復: 0

Fluid design has the advantage

[複製鏈接]

1

主題

1

帖子

5

積分

新手上路

Rank: 1

積分
5
發表於 2023-12-27 11:35:14 | 顯示全部樓層 |閱讀模式

Adevices not to mention potential future devices with new screen dimensions. If youre going to follow this approach youll need to regularly test your pages across different screens and adjust your breakpoints accordingly. Or you could try another approach fluid text. Well discuss that next. Method 2 Fluid Text In fluid web design the size of page elements is set proportional to the width of the screen or browser window. While breakpoints only change the font size at defined increments fluid text scales continuously as the screen dimensions change to fit the viewing device.of not needing to specify screen dimensions in your CSS rules. Fluid text uses the vw unit. As mentioned.



Problems when using vw by itself as it can cause text to blow up massively or shrink to microscopic levels. With some basic math however we can control the behavior of vw. To make fluid text well be combining Digital Marketing Service vw and rem units using the CSS calc function. calc lets us conduct arithmetic operations in CSS even between different units. Heres the HTML and CSS HTML pIm a paragraph of fluid text. Change the width of your browser window and see how I reactp CSS html fontsize 16px p fontsize calc1rem 1vw First we set the font size of the root element.





Again this is standard. Then we use the calc function to make things fluid. With this code the font inside p will scale onetoone with the viewport. The addition of 1rem ensures that the text will always be at least 16 pixels even when the viewport is zero pixels wide. This keeps the text at a readable size on all screens. Open this example in a new tab and try resizing it yourself. However this method comes with tradeoffs as well. Unlike using breakpoints your font sizes will be more approximate and not exactly defined.


回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

QQ|Archiver|手機版|自動贊助|图片情报站

GMT+8, 2025-4-29 05:10 , Processed in 1.330473 second(s), 18 queries .

抗攻擊 by GameHost X3.4

© 2001-2017 Comsenz Inc.

快速回復 返回頂部 返回列表
一粒米 | 中興米 | 論壇美工 | 設計 抗ddos | 天堂私服 | ddos | ddos | 防ddos | 防禦ddos | 防ddos主機 | 天堂美工 | 設計 防ddos主機 | 抗ddos主機 | 抗ddos | 抗ddos主機 | 抗攻擊論壇 | 天堂自動贊助 | 免費論壇 | 天堂私服 | 天堂123 | 台南清潔 | 天堂 | 天堂私服 | 免費論壇申請 | 抗ddos | 虛擬主機 | 實體主機 | vps | 網域註冊 | 抗攻擊遊戲主機 | ddos |