[WebTech #60] CSS > 3. CSS 語法 > 3-2 屬性(Properties)
匹配規則(Selector)是骨,屬性(Properties)是肉!
剛剛提過 CSS 就是由大量的「匹配規則」(Selector,或譯「選擇器」)組成的。每個匹配規則大致都長成這樣:
匹配規則 {
屬性1:屬性值1;
屬性2:屬性值2;
...
}
範例如下:
a {
color: red;
font-size: large;
}
這會匹配 ... 之間的文字,然後把字體改大、套用紅色。如果您 30 幾種常用的匹配規則文法都學會了,那麼接下來就是該學 { ... } 之間的屬性了!如果屬性全會,那麼你的 CSS 就學完、沒啦! :-)
我個人會把這些屬性分為下列這幾類:
(1) 文字(Text):字型、字體、對齊、間隔、粗細、顏色...
(2) 邊框(Box)與表格(Table)
(3) 大小、距離、排版
(4) 照片、多媒體
(5) 型變、動畫
我先給大家看篇屬性的簡介,下午再提供每種屬性的細部講解給大家喔!
http://reference.sitepoint.com/css/propertyref
請由左手邊選單點擊您想看的主題,繼續點子選項閱讀即可。
同時也有4部Youtube影片,追蹤數超過1萬的網紅小豆,也在其Youtube影片中提到,CSS碼 ↓ /* Background colors*/ body { background-color: rgba(0,0,0,0); } /* Transparent background. */ yt-live-chat-renderer { background-color: tr...
「css text size」的推薦目錄:
- 關於css text size 在 紀老師程式教學網 Facebook 的精選貼文
- 關於css text size 在 紀老師程式教學網 Facebook 的最佳貼文
- 關於css text size 在 小豆 Youtube 的最佳貼文
- 關於css text size 在 修分靈 Youtube 的最佳解答
- 關於css text size 在 狗魚 Youtube 的最讚貼文
- 關於css text size 在 How to Set Font Size in CSS | Amit Thinks | 2022 - YouTube 的評價
- 關於css text size 在 css - Font scaling based on size of container - Stack Overflow 的評價
- 關於css text size 在 CSS text size conversion table 的評價
- 關於css text size 在 Accessibility in browsers: zoom level vs. font size - GitHub Gist 的評價
- 關於css text size 在 How to set community font size - Salesforce Stack Exchange 的評價
css text size 在 紀老師程式教學網 Facebook 的最佳貼文
如何設定 CSS,讓您的網頁在 Windows 與 Mac 都能顯示楷書
今天在設計網頁時,遇到一個小問題:有個網頁的「抬頭」(Title),我希望用「楷書」來呈現,好讓它與其它區塊有所視覺上的區隔。雖然有人說「楷書只適合印刷用,電腦上看楷書都會糊糊的,不舒服」,但我試過好幾種手法,還是覺得那個文章標題用「楷書」來呈現,最漂亮、最得我心。加上它是標題,使用 48 點字,應該不會有看起來糊糊的缺點。所以就著手做了。
眾所周知,網頁中要讓某一段文字變成標楷體,可以使用 CSS 中的「font-family」屬性指定。如下所示:
HTML 部份:
CSS 部份:
.my-style {
font-size: 48px;
font-family: "標楷體";
text-align:center;
}
就會做出「置中、48 點字、標楷體」的字樣來。但若對方使用的瀏覽器,執行於國別設定不為「中文(繁體,台灣)」的話,它就會用英文名稱抓字型,必須設定成:
font-family: "標楷體", DFKai-sb;
若你把這樣的網頁放到 Mac 上去執行時,Mac 的標楷體名稱叫做「BiauKai」,所以還得補上「BiauKai」,才能讓 Mac 下也看得到標楷體:
font-family: "標楷體", DFKai-sb, BiauKai;
至於我個人最愛的 Linux,我還沒找到方法。由於我用 Linux 是為了寫程式,所以故意灌成英文版。若有人能依照上述方法,找到 Linux 內建標楷體的字型名稱(有嗎?XD),麻煩您提供一下,不勝感激!
本篇參考資料:
[CSS] 網頁字體: http://kuoe0.ch/1110/css-web-font/
CSS -- 中英文字型家族相關整理: http://blog.kkbruce.net/2010/11/blog-post_23.html
css text size 在 小豆 Youtube 的最佳貼文
CSS碼 ↓
/* Background colors*/
body {
background-color: rgba(0,0,0,0);
}
/* Transparent background. */
yt-live-chat-renderer {
background-color: transparent !important;
}
/* Outlines */
yt-live-chat-renderer * {
text-shadow: -2px -2px #000000,-2px -1px #000000,-2px 0px #000000,-2px 1px #000000,-2px 2px #000000,-1px -2px #000000,-1px -1px #000000,-1px 0px #000000,-1px 1px #000000,-1px 2px #000000,0px -2px #000000,0px -1px #000000,0px 0px #000000,0px 1px #000000,0px 2px #000000,1px -2px #000000,1px -1px #000000,1px 0px #000000,1px 1px #000000,1px 2px #000000,2px -2px #000000,2px -1px #000000,2px 0px #000000,2px 1px #000000,2px 2px #000000;
font-family: "Microsoft JhengHei";
font-size: 24px !important;
line-height: 24px !important;
}
yt-live-chat-text-message-renderer #content ,
yt-live-chat-legacy-paid-message-renderer #content {
overflow: initial; !important
}
/* Hide scrollbar. */
yt-live-chat-item-list-renderer #items {
overflow: hidden !important;
}
yt-live-chat-item-list-renderer #item -scroller{
overflow: hidden !important;
}
/* Hide header and input. */
yt-live-chat-header-renderer,
yt-live-chat-message-input-renderer {
display: none !important;
}
/* Reduce side padding. */
yt-live-chat-text-message-renderer,
yt-live-chat-legacy-paid-message-renderer {
padding-left: 4px !important;
padding-right: 4px !important;
}
yt-live-chat-paid-message-renderer #header {
padding-left: 4px !important;
padding-right: 4px !important;
}
/* Avatars. */
yt-live-chat-text-message-renderer #author -photo,
yt-live-chat-paid-message-renderer #author -photo,
yt-live-chat-legacy-paid-message-renderer #author -photo {
width: 30px !important;
height: 30px !important;
border-radius: 30px !important;
margin-right: 7.5px !important;
}
/* Hide badges. */
yt-live-chat-text-message-renderer #author -badges {
display: none !important;
vertical-align: text-top !important;
}
/* Timestamps. */
yt-live-chat-text-message-renderer #timestamp {
color: #999999 !important;
font-family: "Microsoft JhengHei";
font-size: 12px !important;
line-height: 12px !important;
}
/* Badges. */
yt-live-chat-text-message-renderer #author -name[type="owner"],
yt-live-chat-text-message-renderer yt-live-chat-author-badge-renderer[type="owner"] {
color: #ffd600 !important;
}
yt-live-chat-text-message-renderer #author -name[type="moderator"],
yt-live-chat-text-message-renderer yt-live-chat-author-badge-renderer[type="moderator"] {
color: #5e84f1 !important;
}
yt-live-chat-text-message-renderer #author -name[type="member"],
yt-live-chat-text-message-renderer yt-live-chat-author-badge-renderer[type="member"] {
color: #0f9d58 !important;
}
/* Channel names. */
yt-live-chat-text-message-renderer #author -name {
color: #FF9966 !important;
font-family: "Microsoft JhengHei";
font-size: 28px !important;
line-height: 28px !important;
}
yt-live-chat-text-message-renderer #author -name::after {
content: ":";
margin-left: 2px;
}
/* Messages. */
yt-live-chat-text-message-renderer #message ,
yt-live-chat-text-message-renderer #message * {
color: #ffffff !important;
font-family: "Microsoft JhengHei";
font-size: 28px !important;
line-height: 28px !important;
}
/* SuperChat/Fan Funding Messages. */
yt-live-chat-paid-message-renderer #author -name,
yt-live-chat-paid-message-renderer #author -name *,
yt-live-chat-legacy-paid-message-renderer #event -text,
yt-live-chat-legacy-paid-message-renderer #event -text * {
color: #ffd600 !important;
font-family: "Microsoft JhengHei";
font-size: 28px !important;
line-height: 28px !important;
}
yt-live-chat-paid-message-renderer #purchase -amount,
yt-live-chat-paid-message-renderer #purchase -amount *,
yt-live-chat-legacy-paid-message-renderer #detail -text,
yt-live-chat-legacy-paid-message-renderer #detail -text * {
color: #ffd600 !important;
font-family: "Microsoft JhengHei";
font-size: 28px !important;
line-height: 28px !important;
}
yt-live-chat-paid-message-renderer #content ,
yt-live-chat-paid-message-renderer #content * {
color: #ffffff !important;
font-family: "Microsoft JhengHei";
font-size: 30px !important;
line-height: 30px !important;
}
yt-live-chat-paid-message-renderer {
margin: 4px 0 !important;
}
yt-live-chat-legacy-paid-message-renderer {
background-color: #0f9d58 !important;
margin: 4px 0 !important;
}
yt-live-chat-text-message-renderer a,
yt-live-chat-legacy-paid-message-renderer a {
text-decoration: none !important;
}
yt-live-chat-text-message-renderer[is-deleted],
yt-live-chat-legacy-paid-message-renderer[is-deleted] {
display: none !important;
}
yt-live-chat-ticker-renderer {
background-color: transparent !important;
box-shadow: none !important;
}
yt-live-chat-ticker-paid-message-item-renderer,
yt-live-chat-ticker-paid-message-item-renderer *,
yt-live-chat-ticker-sponsor-item-renderer,
yt-live-chat-ticker-sponsor-item-renderer * {
color: #ffd600 !important;
font-family: "Microsoft JhengHei";
}
![post-title](https://i.ytimg.com/vi/f-468cwubfs/hqdefault.jpg?sqp=-oaymwEZCNACELwBSFXyq4qpAwsIARUAAIhCGAFwAQ==&rs=AOn4CLD-_WAz80qeCgdXXcR2qhixZ2bUxA)
css text size 在 修分靈 Youtube 的最佳解答
語法網站:https://chatv2.septapus.com/
兩段語法(請複製貼上更改)
/* Channel names. */
yt-live-chat-text-message-renderer #author-name {
color: #FF9966 !important;
font-family: "Microsoft JhengHei";
font-size: 28px !important;
line-height: 28px !important;
}
/* Messages. */
yt-live-chat-text-message-renderer #message,
yt-live-chat-text-message-renderer #message *,
yt-live-chat-legacy-paid-message-renderer #detail-text,
yt-live-chat-legacy-paid-message-renderer #detail-text * {
color: #ffffff !important;
font-family: "Microsoft JhengHei";
font-size: 28px !important;
line-height: 28px !important;
}
![post-title](https://i.ytimg.com/vi/pMXElFFTXWk/hqdefault.jpg)
css text size 在 狗魚 Youtube 的最讚貼文
subgoal: https://agentc0re.com/Sub-Counter
訂閱通知: https://streamlabs.com/
聊天室CSS:
body {
background-color: transparent !important;
}
/* Transparent background. */
yt-live-chat-renderer {
background-color: transparent !important;
}
/* Outlines */
yt-live-chat-renderer * {
text-shadow: -2px -2px #000000,-2px -1px #000000,-2px 0px #000000,-2px 1px #000000,-2px 2px #000000,-1px -2px #000000,-1px -1px #000000,-1px 0px #000000,-1px 1px #000000,-1px 2px #000000,0px -2px #000000,0px -1px #000000,0px 0px #000000,0px 1px #000000,0px 2px #000000,1px -2px #000000,1px -1px #000000,1px 0px #000000,1px 1px #000000,1px 2px #000000,2px -2px #000000,2px -1px #000000,2px 0px #000000,2px 1px #000000,2px 2px #000000;
font-family: "Laila";
font-size: 18px !important;
line-height: 18px !important;
}
yt-live-chat-text-message-renderer #content ,
yt-live-chat-legacy-paid-message-renderer #content {
overflow: initial; !important
}
/* Hide scrollbar. */
yt-live-chat-item-list-renderer #items {
overflow:hidden !important;
}
/* Hide header and input. */
yt-live-chat-header-renderer,
yt-live-chat-message-input-renderer {
display: none !important;
}
/* Reduce side padding. */
yt-live-chat-text-message-renderer,
yt-live-chat-legacy-paid-message-renderer {
padding-left: 4px !important;
padding-right: 4px !important;
}
/* Avatars. */
yt-live-chat-text-message-renderer #author -photo,
yt-live-chat-legacy-paid-message-renderer #author -photo { width: 25px !important;
height: 25px !important;
border-radius: 25px !important;
margin-right: 6.25px !important;
}
/* Hide badges. */
yt-live-chat-text-message-renderer #author -badges {
display: none !important;
vertical-align: text-top !important;
}
/* Timestamps. */
yt-live-chat-text-message-renderer #timestamp { color: #999999 !important;
font-family: "Imprima";
font-size: 16px !important;
line-height: 16px !important;
}
/* Badges. */
yt-live-chat-text-message-renderer #author -name[type="owner"],
yt-live-chat-text-message-renderer yt-live-chat-author-badge-renderer[type="owner"] {
color: #FFCC33 !important;
}
yt-live-chat-text-message-renderer #author -name[type="moderator"],
yt-live-chat-text-message-renderer yt-live-chat-author-badge-renderer[type="moderator"] {
color: #FF9966 !important;
}
yt-live-chat-text-message-renderer #author -name[type="member"],
yt-live-chat-text-message-renderer yt-live-chat-author-badge-renderer[type="member"] {
color: #FF9966 !important;
}
/* Channel names. */
yt-live-chat-text-message-renderer #author -name {
color: #FF9966 !important;
font-family: "Microsoft JhengHei";
font-size: 28px !important;
line-height: 28px !important;
}
yt-live-chat-text-message-renderer #author -name::after {
content: ":";
margin-left: 2px;
}
/* Messages. */
yt-live-chat-text-message-renderer #message ,
yt-live-chat-text-message-renderer #message *,
yt-live-chat-legacy-paid-message-renderer #detail -text,
yt-live-chat-legacy-paid-message-renderer #detail -text * {
color: #ffffff !important;
font-family: "Microsoft JhengHei";
font-size: 28px !important;
line-height: 28px !important;
}
/* Fan Funding Messages. */
yt-live-chat-legacy-paid-message-renderer #event -text {
color: #ffffff !important;
font-family: "Microsoft JhengHei";
font-size: 20px !important;
line-height: 20px !important;
}
yt-live-chat-legacy-paid-message-renderer #detail -text,
yt-live-chat-legacy-paid-message-renderer #detail -text * {
color: #ffffff !important;
font-family: "Imprima";
font-size: 18px !important;
line-height: 18px !important;
}
yt-live-chat-legacy-paid-message-renderer {
background-color: #00ffff !important;
margin: 4px 0 !important;
padding: 4px !important;
}
yt-live-chat-text-message-renderer a,
yt-live-chat-legacy-paid-message-renderer a {
text-decoration: none !important;
}
yt-live-chat-text-message-renderer[is-deleted],
yt-live-chat-legacy-paid-message-renderer[is-deleted] {
display: none !important;
}
____________________________________
♪ Power For Tommorow - http://www.rengoku-teien.com
____________________________________
訂閱狗魚: https://www.youtube.com/channel/UC3X3...
粉絲專頁: https://www.facebook.com/dofi13579/
狗魚精華: https://www.youtube.com/playlist?list...
合作邀約:13825774632p@gmail.com
實況委託: https://docs.google.com/forms/d/1BY8H...
![post-title](https://i.ytimg.com/vi/a2exmUXzwkc/hqdefault.jpg?sqp=-oaymwEZCNACELwBSFXyq4qpAwsIARUAAIhCGAFwAQ==&rs=AOn4CLB2WxJnMooDQ_Rl4koCgYhjjJZRLQ)
css text size 在 CSS text size conversion table 的推薦與評價
Points Pixels Ems/Rems Percent Keyword
6pt 8px 0.5em 50%
7pt 9px 0.5625em 56%
7.5pt 10px 0.625em 62.5% x‑small ... <看更多>
css text size 在 How to Set Font Size in CSS | Amit Thinks | 2022 - YouTube 的推薦與評價
In this video, learn to set the font size with the font - size CSS property. Set the size in px or %. Additionally, here are the other values, ... ... <看更多>