首頁  >  文章  >  web前端  >  css用list-style-type屬性後顯示到文字後面

css用list-style-type屬性後顯示到文字後面

黄舟
黄舟原創
2017-06-29 13:45:341783瀏覽

css用list-style-type屬性後顯示到文字後面

那個黑點顯示在了日期地方是什麼問題,

css用list-style-type屬性後顯示到文字後面

第一種情況直接修改list-style-position:outside;為list-style-position:inside;沒有的話就加上去。

方法二:在list-style-position:outside;的情況下給列表符號留個位置來顯示,比如說給li加個屬性margin-left:50px;第二種情況直接刪掉浮動元素float即可。

擴充功能:list-style-type:定義清單樣式
disc: 點
circle: 圓圈
square: 方塊
decimal: 數字,例如1,2, 3,,....,11,12,13
decimal-leading-zero: 十進位數,不足兩位的補齊前導0,例如: 01, 02, 03, ..., 98, 99
lower-roman: 小寫羅馬文字,例如: i, ii, iii, iv, v, ...
upper-roman: 大寫羅馬文字,例如: I, II, III, IV, V, .. .
lower-greek: 小寫希臘字母,例如: α(alpha), β(beta), γ(gamma), ...
lower-latin: 小寫拉丁文,例如: a, b, c , ... z
upper-latin: 大寫拉丁文,例如: A, B, C, ... Z
armenian: 亞美尼亞數字
georgian: 喬治亞數字,例如: an, ban, gan , ..., he, tan, in, in-an, ...
lower-alpha: 小寫拉丁文,例如: a, b, c, ... z
upper-alpha: 大寫拉丁文,例如: A, B, C, ... Z
none: 無(取消所有的list樣式)
inherit:繼承
自訂圖片:list-style:square inside url

簡寫規則:list-style:square inside url('arrow.gif');前面藍色的square為列表符號list-style-type,中間紅色的inside為list-style-position定位符,最後面綠色的url是圖片路徑list-style-image,如果存在這個圖片就會覆蓋前面的square,如果不存在就用square顯示。

.cen5 li a{display:inline-block;width:480px;height:20px;line-height:20px;margin-top:3px}
.ileft{display:inline-block}

你可以在文字前面自己寫一個黑點啊,或是上傳圖片啊,例如

  • 聯絡

  • 你可以在i上傳一個背景圖啊,

    以上是css用list-style-type屬性後顯示到文字後面的詳細內容。更多資訊請關注PHP中文網其他相關文章!

    陳述:
    本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn