Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 06-15-2014, 04:52 AM   #1
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
list-style-type bullet

Hello,

I want to style a list just like the one in Microsoft Word. (View attached)

I used the following CSS code to style it:
Code:
.List-Style2
{
	list-style-type:none;
}

.List-Paragraph2:before {
	content: "\0x0076";
}
This doesn't work, I tried all sorts of codes but nothing seems to work, I prefer to avoid image if there is a working code for this because of scalability.

Do I have to embed a font to get this symbol?
Attached Images
 

Last edited by odedta; 06-15-2014 at 05:01 AM.
odedta is offline   Reply With Quote
Old 06-15-2014, 09:44 AM   #2
DomesticExtremis
Addict
DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.DomesticExtremis ought to be getting tired of karma fortunes by now.
 
DomesticExtremis's Avatar
 
Posts: 243
Karma: 359054
Join Date: Nov 2012
Device: default
Have you tried:

content: "&#x0076";

?
DomesticExtremis is offline   Reply With Quote
Advert
Old 06-15-2014, 01:59 PM   #3
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by odedta View Post
Hello,

I want to style a list just like the one in Microsoft Word. (View attached)

I used the following CSS code to style it:
Code:
.List-Style2
{
	list-style-type:none;
}

.List-Paragraph2:before {
	content: "\0x0076";
}
This doesn't work, I tried all sorts of codes but nothing seems to work, I prefer to avoid image if there is a working code for this because of scalability.

Do I have to embed a font to get this symbol?
Try this, maybe it works:

1. In your .css stylesheet:

Code:
.List-Style2 {
    display: list-item;
    margin-left: 2em;
    list-style-type: none;
}

.List-Style2:before {
    margin-left: -1.1em;
    content: "❖ ";
}
2. In your .xhtml file:

Code:
<p class="List-Style2">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac tellus nunc. Phasellus imperdiet leo metus, et gravida lacus. Donec metus ligula, elementum at pellentesque pellentesque, suscipit ac nunc.</p>
Of course, since we are using the :before pseudo-element, we are going to have some "issues" under ADE.

Regards
Rubén
RbnJrg is offline   Reply With Quote
Old 06-16-2014, 05:30 AM   #4
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
Quote:
Originally Posted by RbnJrg View Post
Of course, since we are using the :before pseudo-element, we are going to have some "issues" under ADE.

Regards
Rubén
I'd like to have best compatibility so what do you suggest? using images and droppping scalability? or sticking to this solution?

EDIT: I have tried every solution people offered here and it doesn't work. I assume it's because I need to embed the Windings font.

EDIT2: argh, I created a new ePub in Sigil with the settings you gave and it works perfect. Thanks RbnJrg.

EDIT3: I am having a bit of trouble with setting this right for hebrew text: see attached for result. CSS code is here:
Code:
body
{
	font-family:"Arial";
	margin:0;
	padding:0;
}
.List-Style2 {
    display: inline;
    margin-left: 2em;
    list-style-type: none;
}

.List-Style2:before {
    margin-right: 1em;
    content: "❖ ";
}
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	229
Size:	11.0 KB
ID:	124245  
Attached Files
File Type: epub untitled.epub (52.6 KB, 204 views)

Last edited by odedta; 06-16-2014 at 06:16 AM.
odedta is offline   Reply With Quote
Old 06-17-2014, 04:02 AM   #5
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
I also want this kind of list (see attached - with the star)

So I used this CSS code:
Quote:
.List-Paragraph3:before {
margin-right:-1.3em;
content: "★ ";
}
And got this result (see attached)
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	213
Size:	2.4 KB
ID:	124271  
Attached Images
 
odedta is offline   Reply With Quote
Advert
Old 06-17-2014, 07:30 AM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Html lists are one of those things that are guaranteed to render differently on different devices/apps. The more "creative" you get with them (or their css), the higher the chance that your intentions for them will fail on anything but one targeted platform.
DiapDealer is offline   Reply With Quote
Old 06-17-2014, 09:13 AM   #7
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by odedta View Post
I'd like to have best compatibility so what do you suggest? using images and droppping scalability? or sticking to this solution?
For best compatibility, I'd suggest to use a svg image, so you won't have any problem with scalability. Personally I use a lot of svg images as fleurons and separators.

Quote:
EDIT2: argh, I created a new ePub in Sigil with the settings you gave and it works perfect. Thanks RbnJrg.
You are welcome

Quote:
EDIT3: I am having a bit of trouble with setting this right for hebrew text: see attached for result. CSS code is here:

Code:
body
{
    font-family:"Arial";
    margin:0;
    padding:0;
}
.List-Style2 {
    display: inline;
    margin-left: 2em;
    list-style-type: none;
}

.List-Style2:before {
    margin-right: 1em;
    content: "❖ ";
}
Hmmm, I think you should use:

Code:
body {
    font-family: "Arial";
    margin:0;
    padding: 0;
    direction: rtl; /* in order to set the writting direction from right to left */
}
.List-Style2 {
    display: list-item; /* display as list-item and not inline */
    margin-right: 1em; /* here margin-right instead of margin-left */
    list-style-type: none;
}

.List-Style2:before {
    margin-right: -1em;
    content: " ❖"; /* here the space is BEFORE the symbol */
}
I think the code should work

Regards
Rubén

Last edited by RbnJrg; 06-17-2014 at 09:29 AM.
RbnJrg is offline   Reply With Quote
Old 06-17-2014, 11:06 AM   #8
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
Well, this works:
Code:
.List-Style3 {
  list-style-type: none;
}
.List-Paragraph3 {
  font-family: "Arial", sans-serif;
  font-size: 0.8em;
  text-align: justify;
  display:list-item;
}
.List-Paragraph3:before {
  margin-right:-1.3em;
  content: "★ ";
}
for html:
Code:
<ul class="List-Style3">
      <li class="List-Paragraph3">אני ואני בלבד אחראי ליצור אושר בחיי.</li>
</u>
Turns out you were right, the font mattered, if I used "Arial" instead of some other font I embedded it will work, the problem is now that I don't want the list items to show in Arial so I need to use a span tag for this symbol, oh well, this seems fixed.

On a side note, don't use the CSS rule:
Code:
direction:rtl
Instead use:
Code:
dir="rtl"
In your html files in order to get the desired effect since direction:rtl will not pass validation for EPUB3.
Of course this is a bit silly since both will work, but myself, like some others like to get their files validated.

Thanks again.
odedta is offline   Reply With Quote
Old 06-17-2014, 02:15 PM   #9
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by odedta View Post
Well, this works:
Code:
.List-Style3 {
  list-style-type: none;
}
.List-Paragraph3 {
  font-family: "Arial", sans-serif;
  font-size: 0.8em;
  text-align: justify;
  display:list-item;
}
.List-Paragraph3:before {
  margin-right:-1.3em;
  content: "★ ";
}
for html:
Code:
<ul class="List-Style3">
      <li class="List-Paragraph3">אני ואני בלבד אחראי ליצור אושר בחיי.</li>
</u>
Turns out you were right, the font mattered, if I used "Arial" instead of some other font I embedded it will work, the problem is now that I don't want the list items to show in Arial so I need to use a span tag for this symbol, oh well, this seems fixed.

On a side note, don't use the CSS rule:
Code:
direction:rtl
Instead use:
Code:
dir="rtl"
In your html files in order to get the desired effect since direction:rtl will not pass validation for EPUB3.
Of course this is a bit silly since both will work, but myself, like some others like to get their files validated.

Thanks again.
You are welcome but I'm a bit confused In your "List-Paragraph3" you are not setting the writting direction from right to left, so the list symbol should appear on the left side and not in the right side as you wanted. Besides, if you are using unordered list, then is not necessary for you to use "display: list-item". That property you could employ it if you use <p> tags instead of <li>, for example:

Code:
<div class="List-Style3">
      <p class="List-Paragraph3">אני ואני בלבד אחראי ליצור אושר בחיי.</p>
</div>
Regards
Rubén
RbnJrg is offline   Reply With Quote
Old 06-17-2014, 02:55 PM   #10
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
Arial is a proprietary typeface, so I hope you aren't figuring on distributing it. The wikipedia pages says Liberation Sans is similar, but whether it works the same way for this stuff you'll have to find out.
mrmikel is offline   Reply With Quote
Old 06-17-2014, 07:06 PM   #11
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
@Ruben: not if my HTML contains the attribute dir="rtl" and it does

@mrmikel: I'll try it out, thanks.
odedta is offline   Reply With Quote
Old 06-18-2014, 08:07 AM   #12
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by odedta View Post
@Ruben: not if my HTML contains the attribute dir="rtl" and it does
OK! Just a last thing, did you check how the epub looks under ADE? Remember that Nook and Sony are device readers based on ADE.
RbnJrg is offline   Reply With Quote
Old 06-18-2014, 08:13 AM   #13
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
I will soon.
odedta is offline   Reply With Quote
Old 06-18-2014, 08:43 AM   #14
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
There is software, the Sony Reader Library, which pretty closely shows how an epub will be displayed on a Sony Reader:

http://esupport.sony.com/swu/5997/US/EN/
mrmikel is offline   Reply With Quote
Old 06-18-2014, 09:53 AM   #15
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
Quote:
Originally Posted by mrmikel View Post
There is software, the Sony Reader Library, which pretty closely shows how an epub will be displayed on a Sony Reader:

http://esupport.sony.com/swu/5997/US/EN/
Yes I know, once I finish the ePub I will check it on all readers I have access to
odedta is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Where To Put <style type="text/css"> Code SeaCanary Sigil 4 01-28-2014 08:33 PM
Mobi unordered list style framallo Conversion 1 03-23-2011 01:22 PM
Adding a new file type in "Save to device" list LARdT Calibre 1 12-19-2010 11:43 AM
Bullet List / Changes to Boldface soulartist Workshop 7 12-18-2010 08:32 AM
list-style in CSS? frabjous ePub 2 08-13-2009 06:28 PM


All times are GMT -4. The time now is 08:37 PM.


MobileRead.com is a privately owned, operated and funded community.