473,804 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5669
"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.tu t.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.tu t.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:20p t">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:20p t">H</span>ello World</a>
</div>

As one possible way.

Jul 21 '05 #8
Spartanicus wrote:
"Jukka K. Korpela" <jk******@cs.tu t.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.tu t.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
1863
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 the image, and when you clicked the mouse the x-y position of the image pixel the mouse was over was posted back in the form. I just changed the layout of the page so that the image is now in a table that is nested in another table, and the old...
5
2831
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 great, but when I add nested tabs there is a problem with the 'visibility' not being inherited and some parts stay visible in the sub-tabs. Sorry if this is unclear. Here's how I have it layed out: I have a <span> for each content section of...
2
3387
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
9944
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 already in a loop." Then he goes on to portray a contrived example that doesn't tell me under what conditions a nested loop might be favoured as a solution? i.e. what are nested loops useful for? What kinds of algorithms are served by nested loops?...
26
3140
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 code will not be idiomatic C. GCC has an extension to ISO C that permits nested functions: <http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html> For implementing closures they have a serious limitation:
27
2256
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 (hopefully correctly) that (barring compiler optimisations) C will shallow copy the structure into val1.
1
2700
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 table. This all works fine in a datagrid I can add rows to the nested table of any of my customer rows... However in code I can't figure out how to do the same thing... the only function I can find is "GetHistoryRows"... I'm completely lost here -...
36
3405
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 address? I keep feeling like I'm missing something obvious. -Jul To keep things in context, this is in reference to describing functions to a beginner.
8
2763
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 addRow = table.insertRow(rowCount); addRow.id = cnt; var addCell = addRow.insertCell(1); addCell.id = cnt;
0
9595
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10353
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10356
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10099
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9176
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3836
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3003
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.