Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8192393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:10:15+00:00 2026-06-07T04:10:15+00:00

I am trying to access only the ELEMENT for toc-chapter number (1 in this

  • 0

I am trying to access only the ELEMENT for toc-chapter number (1 in this case). The element is in nested classes. I’ve used this approach on toc-section and was able to produce the wanted result.

Css:

.book .toc {

    & > .title{
        font-size: x-large;
        font-weight: bold;
        padding-bottom: .25em;
        margin-bottom:.50em;
        border-bottom: 1px solid @tuscany;          
    }

    & a.target-chapter{
        .cnx-gentext-n{
            &:before{content: "testing";}           
        }   
        color:red ; 
    }
}

HTML:

<div class="toc">
  <div class="title">
    Table of Contents
  </div>

  <ul>
    <li xmlns:d="http://docbook.org/ns/docbook" xmlns:db=
    "http://docbook.org/ns/docbook" xmlns:pmml2svg=
    "https://sourceforge.net/projects/pmml2svg/" xmlns:c="http://cnx.rice.edu/cnxml"
    xmlns:ext="http://cnx.org/ns/docbook+" xmlns:svg="http://www.w3.org/2000/svg"
    xmlns:mml="http://www.w3.org/1998/Math/MathML" class="toc-chapter">
      <a href="#idm3792312" class="target-chapter"><span class=
      "cnx-gentext-chapter cnx-gentext-autogenerated">Chapter</span> <span class=
      "cnx-gentext-chapter cnx-gentext-n">1</span><span class=
      "cnx-gentext-chapter cnx-gentext-autogenerated">.</span> <span class=
      "cnx-gentext-chapter cnx-gentext-t">Aging and the Elderly</span></a>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:10:16+00:00Added an answer on June 7, 2026 at 4:10 am

    Based on your provided info, I would assume that LESS is producing the following css selector (I have not actually recoded your problem in LESS, this is just my interpretation):

    .book .toc a.target-chapter .cnx-gentext-n:before {content: "testing";}
    

    Which should work based on this fiddle. I will assume you are testing in a browser that supports :before (not some old version of IE). So to trouble shoot this, you need to:

    1. Verify that such a selector is in fact being produced.
    2. If NOT, determine what selector string is in fact being produced by your code (if any), and that may lead you to solving your issue.

    If such a correct selector string is being produced, then you need to look at other css (which you have not posted, so I am merely speculating here):

    1. Is some more specific (which seems unlikely) selector string targeting the same thing and overriding it?
    2. Do you elsewhere set the display or color or visibility or some other property on that :before pseudo-element that in fact “hides” the added “testing” from view?
    3. Is your actual use case putting an image as content and are you seeing it not show up in printing (that would be a whole different issue)?

    Basically, if your selector string is coming out correct, there are numerous other things that could be happening, and we would need more details to resolve it. If it is not coming out as above, then I would be interested in know what it is producing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to access a file for xml parsing with this: InputStream inputStream
I am trying to access a particular element of a list of lists in
I'm trying to access window's elements of a program, of which I have only
I am trying to access the parentNode of a button element (div) but I
I am currently trying to use the new approach of using FlexGlobals to access
Trying to access a Servlet from a button on HTML page //Html Page FORM
When trying to access the database, I am unable to access the column. I
Im trying to access the Magento customer session in another part of my website.
Im trying to access a Sql CE 2005 database on a windows mobile device
I am trying to access information on a website that uses frames. When I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.