• Resolved marques_uk

    (@marques_uk)


    Hi,

    I’d like to style page-item-116 on my website, this css code works fine

    .page-item-116 {
      background: url(images/home.png);
      width: 100px; /* Width of the image */
      height: 30px; /* Height of the image, should probably be the same as the others */
      text-indent: -10000px; /* Will make the text go away */
      display: block; }

    However it removes the text to the children pages as well, which I don’t want. Is there a way around this?

    Thanks in advance
    marques_uk

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter marques_uk

    (@marques_uk)

    Apoligise for bumping my post, I still haven’t been able to find a solution to my problems ??

    I’m sure theres someone out there who can help.

    Basically I’m using wp_list_pages with the parameter ‘include’ so only 5 specific pages are listed, these page titles will be images. I can style the parent using the method in the above post but the children of these pages text disappears as well.

    Here’s the code I use to display my menu, currently only page id 116 is being shown with its children.

    <div id="nav">
    <ul>
    <?php
    $page_ids = array(116);
    foreach($page_ids as $page_id) {
      $page = wp_list_pages("echo=0&title_li=&include=$page_id");
      $submenu = wp_list_pages("echo=0&title_li=&child_of=$page_id&depth=1");
      if($submenu) $page = str_replace("</li>", "<ul>$submenu</ul></li>", $page);
      echo $page;
    }?>
    </ul>
    </div>

    Thank you
    marques_uk

    It might help if we could see your site but try .page-item-116 ul li:first-child.

    Thread Starter marques_uk

    (@marques_uk)

    Hi esmi,

    my sites on my local server so can’t give you a link. I’ll provide you with the CSS I have so you can see exactly what I’m doing to style it.

    [98 lines of CSS moderated as per the Forum Rules.]

    but no joy, is it possible to style all children of the page-item class or something?

    Many thanks

    Try a dedicated CSS resource such as https://www.css-discuss.org/ instead. I’d also recommend using Firefox with the Firebug add-on for this kind of CSS work.
    https://getfirebug.com/

    Thread Starter marques_uk

    (@marques_uk)

    thanks found a CSS solution!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Styling .page-item-x Parent?’ is closed to new replies.