🔥 Specificity ใน CSS มีปัญหางั้นหรอ เจอ !important เข้าไปหน่อยเป็นไง !!
.
👉 สำหรับใครที่ไม่เข้าใจ ใน CSS จะมีสิ่งหนึ่งที่เรียกว่า Specificity คือค่าที่บอกลำดับความสำคัญในการกำหนดค่าแสดงลักษณะออกมา ซึ่งเป็นค่าที่จะบอก Browser ว่าให้เลือกใช้ Style ตัวไหนมาแสดงผลหน้าเว็บ ซึ่งแน่นอนว่าจะต้องมีการคำนวณค่าออกมาเพื่อให้ Browser รู้ได้นั่นเอง
.
💻 ให้ความสำคัญกับค่า Specificity ที่มากก่อนเสมอ !!
.
ซึ่งบางทีหากเราเขียน CSS ออกมาแล้วจัดลำดับค่า Specificity ไม่ดี อาจจะทำให้ CSS แสดงผลออกมาไม่เป็นไปตามที่เราคิดเอาไว้
.
❗ การใช้ !important จะเหมือนกับการใส่ค่าความสำคัญให้กับจุด ๆ นั้นเป็น Infinity เลยทีเดียว ใครก็มิอาจแซงได้ ทำให้เหมือนกับเป็นการบังคับให้แสดงผลออกมานั่นเอง
.
✏️ แต่ถ้าหากเป็นไปได้ เราก็ไม่ควรที่จะนำมาใช้งานสักเท่าไรนะครับ เพราะถ้าหากเราบริหารจัดการลำดับของค่า Specificity ให้ดี ก็จะแก้ปัญหาตรงนี้ได้เหมือนกัน และเพื่อที่จะพัฒนาเราให้เป็น Dev ที่ดีอีกด้วย
.
borntoDev - 🦖 สร้างการเรียนรู้ที่ดีสำหรับสายไอทีในทุกวัน
同時也有3部Youtube影片,追蹤數超過1萬的網紅小豆,也在其Youtube影片中提到,CSS碼 ↓ /* Background colors*/ body { background-color: rgba(0,0,0,0); } /* Transparent background. */ yt-live-chat-renderer { background-color: tr...
「important css」的推薦目錄:
- 關於important css 在 BorntoDev Facebook 的精選貼文
- 關於important css 在 站長路可 - 網路創業是一場漫長的自我修煉 Facebook 的最佳貼文
- 關於important css 在 站長路可 - 網路創業是一場漫長的自我修煉 Facebook 的最佳貼文
- 關於important css 在 小豆 Youtube 的最讚貼文
- 關於important css 在 修分靈 Youtube 的最佳解答
- 關於important css 在 狗魚 Youtube 的最讚貼文
- 關於important css 在 Programming Tip #32: What is !important Declaration in CSS 的評價
important css 在 站長路可 - 網路創業是一場漫長的自我修煉 Facebook 的最佳貼文
跟站長學架站 - 如何安裝Justfont付費字型
因為討論群裡面有人問到,如何幫網站安裝付費字型,我就熬夜做了影片啦~
如果你想要把討厭的新細明體換掉,這個方法也同樣適用喔
免費字體我都用雅黑體,我只有在比較注重美觀的網站才會使用付費字型
看完這支影片,你將可以
✅幫網站加上美美的justfont付費字型(例如金萱體)
✅初步了解CSS
✅知道font-family的規則
我使用的CSS程式碼在這,看完影片你就可以看懂了:
body, h1, h2, h3, h4, h5, h6, p, a, div, li, span:not(.ab-icon) {
font-family: jf-jinxuan, 'microsoft yahei', sans-serif !important;
}
important css 在 站長路可 - 網路創業是一場漫長的自我修煉 Facebook 的最佳貼文
跟站長學架站 - 如何安裝Justfont付費字型
因為討論群裡面有人問到,如何幫網站安裝付費字型,我就熬夜做了影片啦~
如果你想要把討厭的新細明體換掉,這個方法也同樣適用喔
免費字體我都用雅黑體,我只有在比較注重美觀的網站才會使用付費字型
看完這支影片,你將可以
✅幫網站加上美美的justfont付費字型(例如金萱體)
✅初步了解CSS
✅知道font-family的規則
我使用的CSS程式碼在這,看完影片你就可以看懂了:
body, h1, h2, h3, h4, h5, h6, p, a, div, li, span:not(.ab-icon) {
font-family: jf-jinxuan, 'microsoft yahei', sans-serif !important;
}
important css 在 小豆 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";
}
important css 在 修分靈 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;
}
important css 在 狗魚 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...
important css 在 Programming Tip #32: What is !important Declaration in CSS 的必吃
Welcome, What is !important Property Concept in CSS | When to use !important in CSS. Important ... ... <看更多>