作者Tahoma (咪醬)
看板Web_Design
標題[問題] content="."的意思是?
時間Sun Apr 26 10:36:02 2015
我在研究一個網站的寫法,
看到這段css
.clear:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
來源:
http://ideaplusink.com.au/
還想請教這個 content="." 的意思是什麼
為什麼要在該class前面加一個點號呢?
然後整體的class的意思是?
我有查了一下w3s,還是不太懂
http://www.w3schools.com/cssref/pr_gen_content.asp
另外我看它的::after語法是加在html上的
正常來說CSS不是應該寫在css裡面嗎
http://i.imgur.com/gZesxe9.jpg
另外還想要請教一下這個content是否就是很多大陸網站在防別人
複製的語法呢?例如有的小說網站,複製下去的話前後會有
"@ Copyright of 晋江原创网 @ "
晉江原創網
http://www.jjwxc.net/onebook.php?novelid=31065&chapterid=1
還請大家指教,謝謝~~~~
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.224.220.191
※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1430015768.A.1DF.html
※ 編輯: Tahoma (36.224.220.191), 04/26/2015 10:36:29
※ 編輯: Tahoma (36.224.220.191), 04/26/2015 11:04:49
推 ymcheung: 你提到的這段剛好是 clearfix的用法 解決float排版問題 04/26 11:17
→ ymcheung: 平常的content就是顯示引號內的內容 04/26 11:17
推 clerkhsiao: 他的after應該是用js動態配置的 04/26 16:05
推 iamnodoubt: css會有些很奇怪的技巧,沒什邏輯的,就memo起來 04/26 17:45
推 eight0: IE 在處理 content: "" 或 content: " " 時會有高度問題 04/26 18:29
→ eight0: 所以有時會改成 content: "x" + visibility: hidden 04/26 18:29
推 hit1205: 你最後舉的網站其實只是把那些字設定成和底色一樣而已 XD 04/27 14:39