CSS文本多出變爲.....應用

<title>無標題文檔</title>

<style type="text/css">
p:first-letter{ font-size:28px}  
</style>
</head>

<body>
<div id="webjx"></div>
   <script>setInterval("webjx.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);
   </script>

<p style="width:100px; height:25px; line-height:25px;text-overflow:ellipsis;overflow:hidden; white-space:nowrap;">即可到聖誕節啥考試死定了</p>
<a style="display:inline-block;width:100px; height:25px; line-height:25px;text-overflow:ellipsis;overflow:hidden; white-space:nowrap;" href="#" title="即可到聖誕節啥考試死定了">即可到聖誕節啥考試死定了</a>
<!--要實現溢出時產生省略號的效果還須定義:強制文本在一行內顯示(white-space:nowrap)及溢出內容爲隱藏(overflow:hidden),只有這樣才能實現溢出文本顯示省略號的效果。 -->
支持所有的瀏覽器
</body>
</html>



網上找的,試過,可以撒;

  <script>setInterval("webjx.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);
   </script>

這個,是可以更新當前時間的,不錯的方法,可以用一下下

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章