5 Replies - 152 Views - Last Post: 11 January 2018 - 04:34 AM

#1 gunitinug  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 08-July 14

Setting list-style-type to a string

Posted 01 January 2018 - 08:31 PM

Please refer to:
https://jsfiddle.net/jzsvjry2/

I'm trying to set list marker to a string(in this case -) using
list-style-type: '-';


I was expecting output

-123
-456
-789

But list-style-type has no effect. thanks
Is This A Good Question/Topic? 0
  • +

Replies To: Setting list-style-type to a string

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 13661
  • View blog
  • Posts: 54,531
  • Joined: 12-June 08

Re: Setting list-style-type to a string

Posted 01 January 2018 - 08:44 PM

Set the list style to none and then use 'li:before' to set 'content' to your symbol.
Was This Post Helpful? 0
  • +
  • -

#3 gunitinug  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 08-July 14

Re: Setting list-style-type to a string

Posted 01 January 2018 - 08:55 PM

View Postmodi123_1, on 02 January 2018 - 03:44 AM, said:

Set the list style to none and then use 'li:before' to set 'content' to your symbol.


yep thats one way...
https://jsfiddle.net/c720518e/
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw  Icon User is offline

  • blow up my boots
  • member icon

Reputation: 6444
  • View blog
  • Posts: 26,066
  • Joined: 12-December 12

Re: Setting list-style-type to a string

Posted 02 January 2018 - 12:37 AM

The allowed values for list-style-type has no provision for a custom character.
Was This Post Helpful? 0
  • +
  • -

#5 nensi.panjwani  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 8
  • Joined: 10-January 18

Re: Setting list-style-type to a string

Posted 11 January 2018 - 04:23 AM

Hi,

You can refer below link
output link

Thanks.
Was This Post Helpful? 0
  • +
  • -

#6 andrewsw  Icon User is offline

  • blow up my boots
  • member icon

Reputation: 6444
  • View blog
  • Posts: 26,066
  • Joined: 12-December 12

Re: Setting list-style-type to a string

Posted 11 January 2018 - 04:34 AM

gunitinug and nensi.panjwani post the code directly here in the forum between code tags not just as external links that will likely disappear (particularly when the code is of short length).
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1