CSS margin padding wordSpacing 屬性

來源:互聯網
上載者:User

標籤:style   http   io   java   strong   ar   div   cti   html   

margin 外邊距

padding 內邊距

四個參數時依次表示 上 右 下 左 距離

例子 1
padding:10px 5px 15px 20px;
  • 上內邊距是 10px
  • 右內邊距是 5px
  • 下內邊距是 15px
  • 左內邊距是 20px
例子 2
padding:10px 5px 15px;
  • 上內邊距是 10px
  • 右內邊距和左內邊距是 5px
  • 下內邊距是 15px
例子 3
padding:10px 5px;
  • 上內邊距和下內邊距是 10px
  • 右內邊距和左內邊距是 5px
例子 4
padding:10px;
  • 所有 4 個內邊距都是 10px

 

定義和用法

wordSpacing 屬性設定文本中的單詞間距。

文法:
Object.style.wordSpacing=normal|length
可能的值
值 描述
normal 預設。定義單詞間的標準空間。
length 定義單詞間的固定空間。
執行個體

本例改變單詞間的間距:

<html><head><script type="text/javascript">function changeWordSpacing(){document.getElementById("p1").style.wordSpacing="10px";}</script></head><body><p id="p1">This is an example paragraph</p><input type="button" onclick="changeWordSpacing()" value="Change space between words" /></body></html>
TIY
wordSpacing - 改變單詞間的間距

HTML DOM Style 對象

CSS margin padding wordSpacing 屬性

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.