473,323 Members | 1,547 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

first-letter won't work in anchor

I am trying to get "first-letter" to work inline withing an anchor. Actually
I have not been able to get it to work within an <a> tag whether inline,
linked, or embedded. Using IE6 service pack 1.

<html>
<head>
<style type="text/css">
h5 {background-color: red; padding-left: 5px}
a {color: white; font-size: 20px; text-decoration: none}
</style>
</head>

<body>

<h5 style="first-letter{color:brown}">
<a href="const.htm">Antiques</a></h5>

</body
</html>

TIA, ps****@nospam.eatel.net
<remove ".nospam" to email me>
Jul 20 '05 #1
1 6841
Patrick wrote:
I am trying to get "first-letter" to work inline withing an anchor. Actually
I have not been able to get it to work within an <a> tag whether inline,
linked, or embedded. Using IE6 service pack 1.
Firstly, it doesn't matter which IE you're using, getting it to work
correctly is difficult — of course, this is no exception.
<h5 style="first-letter{color:brown}">


:first-letter is a pseudo element, which requires a :, or :: for CSS3,
to precede it. There is no point to use the style attribute for this,
simply apply the style within the stylesheet in the header, or a linked
stylesheet. This CSS works for Mozilla 1.7 RC2, and Opera 7.5, but not
IE6 SP1. (Only tested on Windows XP, not Linux or Mac)

h5 a { display: block; }

h5 a:link:first-letter,
h5 a:visited:first-letter,
h5 a:hover:first-letter,
h5 a:focus:first-letter,
h5 a:active:first-letter { color: black; }

a:link { color: red; }
a:visited { color: orange; }
a:hover { color: yellow; }
a:focus { color: green; }
a:active { color: blue; }

And this code works for Mozilla, Opera and IE.

h5 a { display: block; }
h5 a:first-letter { color: black; }
a { color: red; }

However, if you extend it using the various link pseudo classes, it
fails miserably in IE, while working perfectly in Mozilla and Opera. IE
will colour the first letter with the color from the applicable a:link
or a:visited style rule, and color the rest in the default visited
(usually purple) or unvisited (usually blue) link colour.

h5 a { display: block; }
h5 a:first-letter { color: black; }
a:link { color: red; }
a:visited { color: green; }

I haven't done a complete test of every variation, so experement with
it and see what you can find that works best for you.

--
Lachlan Hunt
http://www.lachy.id.au/
la**********@lachy.id.au.update.virus.scanners

Remove .update.virus.scanners to email me,
NO SPAM and NO VIRUSES!!!
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Hung Jung Lu | last post by:
Hi, Does anybody know where this term comes from? "First-class object" means "something passable as an argument in a function call", but I fail to see the connection with "object class" or...
4
by: KJ | last post by:
We use a third party software package for acctg that limits us on field size - as a result, we at times have to enter an item into the app multiple times in order to get all the information. I...
5
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test...
2
by: captain_2010 | last post by:
hi, >From below table want only the first value of each item id. and how to get it, tried to use top n function in select statement it takes only the first record. itemid qty 1 10 1...
27
by: hokiegal99 | last post by:
Hi Guys, This is my first C program. I started programming in Python. Please look over this source and let me know if I'm doing anything wrong. I want to start out right with C, so if you see...
8
by: Robert Gravereaux | last post by:
I've noticed that the first exception thrown/caught by an app running in debug is very slow - it takes perhaps 7 or 8 seconds on my P4 machine. I've noticed this on several different machines...
11
by: Jason | last post by:
Hi I have a "problem" i have got a ASP.NET application. in this application i have included logging. in the logging i have logged how many seconds it takes for this application to fully load....
26
by: Martin R | last post by:
Hi, How to find first not null value in column whitout chacking whole table (if there is a not null value then show me it and stop searching, the table is quite big)? thx, Martin *** Sent...
6
by: =?Utf-8?B?UGF1bA==?= | last post by:
HI I have a stored procedure that returns data with a date field in the form of a DateTime type. I need to place data in variables based on days of the week starting with the first thursday of the...
4
by: Milan Krejci | last post by:
int first=15,latest=15; QString typ=NULL; std::map<int,std::string>::iterator i; for(i = SeznamPracovniDoby.begin(); i != SeznamPracovniDoby.end(); i++) { if (typ==NULL) typ=i->second.c_str(); if...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.