473,395 Members | 1,931 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,395 software developers and data experts.

how to I address this particular nested element?

I'd be grateful for some help on this element addressing question. I want to
change the font-size of the "H" of "Hello World" in the following HTML using
first-letter, but cannot "reach" the element.

<div id="napoleon">
<div>
<a id="1000" class="dynamite" href="test.htm">Hello World</a>
</div>
</div>

How do I address the contents of the anchor using a combination class
..dynamite and id #napoleon and the A and DIV selectors? This simple CSS has
no effect: .dynamite:first-letter{ font-size: medium}

Thanks
Timo
Jul 21 '05 #1
9 5650
"Timo" <ti**@anonymous.biz> wrote:
I'd be grateful for some help on this element addressing question. I want to
change the font-size of the "H" of "Hello World" in the following HTML using
first-letter, but cannot "reach" the element.

<div id="napoleon">
<div>
<a id="1000" class="dynamite" href="test.htm">Hello World</a>
</div>
</div>

How do I address the contents of the anchor using a combination class
.dynamite and id #napoleon and the A and DIV selectors? This simple CSS has
no effect: .dynamite:first-letter{ font-size: medium}


From the spec:

"The :first-letter pseudo-element applies to block, list-item,
table-cell, table-caption and inline-block elements."

--
Spartanicus
Jul 21 '05 #2
Spartanicus <me@privacy.net> wrote:
"Timo" <ti**@anonymous.biz> wrote:
I'd be grateful for some help on this element addressing question.
I want to change the font-size of the "H" of "Hello World" in the
following HTML using first-letter, but cannot "reach" the element.

<div id="napoleon"> <div>
<a id="1000" class="dynamite" href="test.htm">Hello World</a>
</div> </div>

How do I address the contents of the anchor using a combination
class .dynamite and id #napoleon and the A and DIV selectors? This
simple CSS has no effect: .dynamite:first-letter{ font-size:
medium}


From the spec:

"The :first-letter pseudo-element applies to block, list-item,
table-cell, table-caption and inline-block elements."


Actually that's from the CSS 2.1 draft (status: Candidate
Recommendation). Formally the current specification is CSS 2.0, which
obscurely says: "The :first-letter pseudo-element matches parts of
block-level elements only."

Anyway, it won't work for an <a> element by default. Here a simple
solution would be to use

#napoleon a { display: block; }
#napoleon a:first-letter { ... }

Alternatively, one could use the pseudo-element for the enclosing
block:

#napoleon div:first-letter { ... }

Using #napoleon:first-letter does not seem to work (on IE 6 or
Mozilla), perhaps due to the intervening <div> markup.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 21 '05 #3
"Jukka K. Korpela" <jk******@cs.tut.fi> wrote:
From the spec:

"The :first-letter pseudo-element applies to block, list-item,
table-cell, table-caption and inline-block elements."


Actually that's from the CSS 2.1 draft (status: Candidate
Recommendation). Formally the current specification is CSS 2.0, which
obscurely says: "The :first-letter pseudo-element matches parts of
block-level elements only."


For the uninitiated: the 2.1 spec is the spec to use regardless of it's
official status.

--
Spartanicus
Jul 21 '05 #4
Spartanicus <me@privacy.net> wrote:
For the uninitiated: the 2.1 spec is the spec to use regardless of
it's official status.


You mean the document that itself explicitly says "It is inappropriate
to cite this document as other than work in progress."?

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 21 '05 #5
"Jukka K. Korpela" <jk******@cs.tut.fi> wrote:
For the uninitiated: the 2.1 spec is the spec to use regardless of
it's official status.


You mean the document that itself explicitly says "It is inappropriate
to cite this document as other than work in progress."?


For the less well informed: Jukka is exercising his pedantic muscle and
should be ignored on this issue.

The CSS 2.0 spec is primarily of historical value, anyone using CSS
should use the 2.1 spec and ignore the above quote.

--
Spartanicus
Jul 21 '05 #6
On Sat, 5 Mar 2005 13:33:15 -0500 Timo wrote:
I'd be grateful for some help on this element addressing question. I want
to change the font-size of the "H" of "Hello World" in the following HTML
using first-letter, but cannot "reach" the element.

<div id="napoleon">
<div>
<a id="1000" class="dynamite" href="test.htm">Hello World</a>
</div>
</div>

How do I address the contents of the anchor using a combination class
.dynamite and id #napoleon and the A and DIV selectors? This simple CSS
has no effect: .dynamite:first-letter{ font-size: medium}

Thanks
Timo


<div>
<a id="1000" class="dynamite" href="#"><span style="font:20pt">H</span>ello
World</a>
</div>

As one possible way.

Jul 21 '05 #7
Thanks, Richard, but I cannot alter the HTML. A program returns the anchor
nested in an unidentified DIV and I insert that HTML into the enclosing div
whose ID = napoleon. Rewriting that anchor-creation program is on the list
of to do items. It would be nice if it allowed me to assign a class to the
DIV that lacks one now.
Timo
"Richard" <An*******@127.001> wrote in message
news:d0*********@news2.newsguy.com...
On Sat, 5 Mar 2005 13:33:15 -0500 Timo wrote:
I'd be grateful for some help on this element addressing question. I want to change the font-size of the "H" of "Hello World" in the following HTML using first-letter, but cannot "reach" the element.

<div id="napoleon">
<div>
<a id="1000" class="dynamite" href="test.htm">Hello World</a>
</div>
</div>

How do I address the contents of the anchor using a combination class
.dynamite and id #napoleon and the A and DIV selectors? This simple CSS
has no effect: .dynamite:first-letter{ font-size: medium}

Thanks
Timo

<div>
<a id="1000" class="dynamite" href="#"><span

style="font:20pt">H</span>ello World</a>
</div>

As one possible way.

Jul 21 '05 #8
Spartanicus wrote:
"Jukka K. Korpela" <jk******@cs.tut.fi> wrote:

For the uninitiated: the 2.1 spec is the spec to use regardless of
it's official status.


You mean the document that itself explicitly says "It is inappropriate
to cite this document as other than work in progress."?

For the less well informed: Jukka is exercising his pedantic muscle and
should be ignored on this issue.

The CSS 2.0 spec is primarily of historical value, anyone using CSS
should use the 2.1 spec and ignore the above quote.


and for everybody that want there css to work: css 2.0 and 2.1 are both
ill-supported by all browsers.

if you want to use it, try your luck, take no good implementation for
granted.
Jul 21 '05 #9
Very disappointing: I was waiting for the part where someone gets hit over
the head with a folding chair. :-)

Spartanicus, thanks for clarifying the spec, and Jukka, thanks for these
suggestions. When I tried them _in vivo_ there were some side-effects (other
A elements were affected, not merely those beneath #napolean) so I seized
the opportunity to rewrite the code that produced the anchor. The anonymous
DIV that enclosed the anchor now has a class reference, and it's much easier
to address the nested anchor.

Timo
"Jukka K. Korpela" <jk******@cs.tut.fi> wrote in message
news:Xn*****************************@193.229.0.31. ..
Spartanicus <me@privacy.net> wrote:
"Timo" <ti**@anonymous.biz> wrote:
I'd be grateful for some help on this element addressing question.
I want to change the font-size of the "H" of "Hello World" in the
following HTML using first-letter, but cannot "reach" the element.

<div id="napoleon"> <div>
<a id="1000" class="dynamite" href="test.htm">Hello World</a>
</div> </div>

How do I address the contents of the anchor using a combination
class .dynamite and id #napoleon and the A and DIV selectors? This
simple CSS has no effect: .dynamite:first-letter{ font-size:
medium}


From the spec:

"The :first-letter pseudo-element applies to block, list-item,
table-cell, table-caption and inline-block elements."


Actually that's from the CSS 2.1 draft (status: Candidate
Recommendation). Formally the current specification is CSS 2.0, which
obscurely says: "The :first-letter pseudo-element matches parts of
block-level elements only."

Anyway, it won't work for an <a> element by default. Here a simple
solution would be to use

#napoleon a { display: block; }
#napoleon a:first-letter { ... }

Alternatively, one could use the pseudo-element for the enclosing
block:

#napoleon div:first-letter { ... }

Using #napoleon:first-letter does not seem to work (on IE 6 or
Mozilla), perhaps due to the intervening <div> markup.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Jul 21 '05 #10

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

Similar topics

1
by: travis_brooks | last post by:
greetings I had a javascript that was reliably telling me the position of an image on a page, and now its not. I was using the script to draw a bounding box that followed the mouse around over...
5
by: horndude77 | last post by:
Ok, this might be for a web designing group, but here's my problem. I'm trying to make a web page with tabs which you can navigate between without the page reloading. I have one set of tabs working...
2
by: yaya9 | last post by:
pls help me! I have a nested xml: <?xml version="1.0" encoding="utf-8" ?> <root> <myType> <FName /> <pop /> </myType> </root>
46
by: Neptune | last post by:
Hello. I am working my way through Zhang's "Teach yourself C in 24 hrs (2e)" (Sam's series), and for nested loops, he writes (p116) "It's often necessary to create a loop even when you are...
26
by: Adam Warner | last post by:
Hello all, I'm very new to C but I have a number of years of Common Lisp programming experience. I'm trying to figure out ways of translating higher order concepts such as closures into C. The...
27
by: Adam Warner | last post by:
Hi all, In the code snippet below I successfully determine the address of val1:* struct o val1=l_SYM_2B(&a).o; print_aesthetic(&val1); The structure o is heavyweight. I understand...
1
by: Benny Raymond | last post by:
I have a dataset setup with a main table that has some information in it along with an element that is a nested table so that I can store rows of history information for that one row in the main...
36
by: Julienne Walker | last post by:
Ignoring implementation details and strictly following the C99 standard in terms of semantics, is there anything fundamentally flawed with describing the use of a (non-inline) function as an...
8
by: phub11 | last post by:
Hi - I have a function which appends row(s) to the bottom of a table: function mouseUpHandler() { var table = document.getElementById("mytable"); var rowCount = table.rows.length; var...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.