Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 03-15-2012, 11:25 AM   #1
Alan Newson
Member
Alan Newson began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Dec 2011
Device: iPad
iBooks ignoring a:link css style

Hi, I'm trying to give a ePub links within iBooks a custom color, but it seems they are being ignored.

I have an external style sheet with the following code:

.contact-web {
text-align: left;
font-size: 0.8em;
font-weight: bold;
margin-bottom: 0em;
-webkit-hyphens: none;
}

.contact-web a {color:#000;text-decoration:none;}
.contact-web a:visited {color:#000;text-decoration:none;}
.contact-web a:hover {color:#000;text-decoration:none;}
.contact-web a:active {color:#000;text-decoration:none;}


And the code I'm trying to link it to within my html is:

<p class="contact-web">For more information, please visit <a href="http://www.mysite.com">www.mysite.com</a></p>


Is it possible to change the color of an ePub hyperlink that works within iBooks?

Thanks
Alan Newson is offline   Reply With Quote
Old 03-15-2012, 11:44 AM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Why don't you just use the following definition in your stylesheet.
Code:
a {
color:#000;
text-decoration:none;
}
That would be sufficient.
Toxaris is offline   Reply With Quote
Advert
Old 03-15-2012, 11:49 AM   #3
Alan Newson
Member
Alan Newson began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Dec 2011
Device: iPad
Yes, that's what I thought. It works on ADE, but when you take it into iBooks on the iPad the link goes back to the default purple.
Alan Newson is offline   Reply With Quote
Old 03-15-2012, 12:25 PM   #4
Keroberos
Zealot
Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.
 
Keroberos's Avatar
 
Posts: 128
Karma: 238654
Join Date: Aug 2009
Device: Kobo Mini (4GB), Nook Classic wi-fi, iPod Touch (Bluefire Reader)
Shouldn't color codes be like these, "color:#000000;" (hex), or "color:rgb(0,0,0);" (rgb value), or "color:black;" (color name)?

Last edited by Keroberos; 03-15-2012 at 12:28 PM.
Keroberos is offline   Reply With Quote
Old 03-15-2012, 03:18 PM   #5
mmat1
Berti
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 1,196
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by Keroberos View Post
Shouldn't color codes be like these, "color:#000000;" (hex), or "color:rgb(0,0,0);" (rgb value), or "color:black;" (color name)?
You're right, all these declarations are valid, but #000 as well.

If I were Allen, i would try any of these.
mmat1 is offline   Reply With Quote
Advert
Old 03-15-2012, 03:22 PM   #6
wqoq
Junior Member
wqoq began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Apr 2010
Location: Regina, SK
Device: iPad, iPhone 4S, Kobo Touch
3 digit Hex values are also viable. It's a short-hand for double digits. Saves 3 bytes!

em { color: #69b } /* #rgb */
em { color: #6699bb } /* #rrggbb */

See:
http://www.w3.org/TR/CSS2/syndata.html#color-units
http://www.w3.org/TR/css3-color/#numerical
wqoq is offline   Reply With Quote
Old 03-15-2012, 03:25 PM   #7
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,669
Karma: 127838212
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
iBooks does what iBooks wants. And that isn't always the way we think it should work.
JSWolf is offline   Reply With Quote
Old 03-15-2012, 04:20 PM   #8
Keroberos
Zealot
Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.
 
Keroberos's Avatar
 
Posts: 128
Karma: 238654
Join Date: Aug 2009
Device: Kobo Mini (4GB), Nook Classic wi-fi, iPod Touch (Bluefire Reader)
Valid, yes. But not necessarily supported. I've read that some renderers don't support three digit hex so I avoid it and stick with the six digit.
Keroberos is offline   Reply With Quote
Old 03-19-2012, 07:13 AM   #9
Alan Newson
Member
Alan Newson began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Dec 2011
Device: iPad
I haven't managed to get the css to control the a:link color within iBooks. But have found out that putting a <span> around the text, inside the <a> tags lets you define a colour.

Probably not ideal. But it did the job for me.
Alan Newson is offline   Reply With Quote
Old 03-19-2012, 07:49 AM   #10
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
That is typical iBooks... A lot of unnecessary <span> tags required.
Toxaris is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Aldiko ignoring style sheet property? purcelljf ePub 6 11-19-2012 08:15 AM
An example file of your CSS style sheet roger64 Writer2ePub 6 04-11-2012 02:59 AM
CSS style, TOC and other stuff sebdea Sigil 8 04-19-2011 03:40 AM
Feature request: CSS style application Fitz Sigil 4 07-25-2010 06:36 AM
list-style in CSS? frabjous ePub 2 08-13-2009 06:28 PM


All times are GMT -4. The time now is 05:51 PM.


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