
內容簡介
這個 WordPress 外掛將一個背景大小控制器新增到 WordPress Customizer 中的「背景圖片」選項中。
您可以透過進入仪表盘的「外觀」>「自訂」,然後點擊「背景圖片」選項,使用這個新控制器。
在您加入自訂背景圖片後,您可以將您的背景圖片大小設定為:
– “Cover”:最大化地填滿整個檢視區,有需要時進行裁切。
– “Contain”:最大限度地顯示整個圖片,但不需裁減成檢視區大小。
– “100% 寬度”:寬度完全符合檢視區大小,可能比檢視區高度大或小(等同於 CSS 中的「100% auto」)。
– “100% 高度”:高度完全符合檢視區大小,可能比檢視區寬度大或小(等同於 CSS 中的「auto 100%」):
– “繼承”:將背景大小設定為與父元素一致(在這個案例中是 HTML)。
– “自訂”:允許您輸入要套用的 CSS,並選擇「CSS for background-size (if 'custom' selected)」選項中的區域。
要了解更多關於 CSS 背景大小屬性的資訊,請前往:
https://developer.mozilla.org/en-US/docs/Web/CSS/background-size
或
http://www.w3schools.com/cssref/css3_pr_background-size.asp
注意事項
*這個外掛是透過新增樣式到「body.custom-background」類別來實現的。如果預設的自訂背景支援有任何問題,則這個外掛無法正常運作。
外掛標籤
開發者團隊
② 後台搜尋「Add Background-Size to Customizer」→ 直接安裝(推薦)
原文外掛簡介
This plugin for WordPress adds a background-size controller to the Background Image section in the WordPress Customizer.
You can access the new controller by going to Appearance > Customize from the Dashboard, and clicking on the Background Image section.
Once you’ve added your custom background image, you can set your background-image size to:
– “Cover”: As large as possible; fills entire view, with cropping.
– “Contain”: As large as possible, without cropping; fits inside of view.
– “100% width”: Width fits view perfectly, height may be smaller or larger than view (equivalent to css ‘100% auto’).
– “100% height”: Height fits view perfectly, width may be smaller or larger than view (equivalent to css ‘auto 100%’).
– “Inherit”: Sets background size to whatever parent element is set to (html, in this case).
– “Custom”: Allows you to put in your own css to be applied in the section called “CSS for background-size (if ‘custom’ selected).”
To learn more about the CSS background-size property, go to:
https://developer.mozilla.org/en-US/docs/Web/CSS/background-size
or
http://www.w3schools.com/cssref/css3_pr_background-size.asp
Notes
Notes:
*The plugin works by adding styles to the body.custom-background class. If the default custom-background support has been disrupted, then this plugin will not work.
