• Resolved Jennifer

    (@jdavidson788)


    Hello!
    I am trying to add a break in my footer widget. I’ve indicated, in the code below, that I would like a “|” between each footer link. The problem is, there is only a space after each link and not before – resulting in the navigation looking like this “Terms of Sale |Privacy Policy |Page |”. I tried creating a style to indicate a space before the child, but that didn’t cut it. Below is the code I’m using. Any help would be appreciated!

    #footer-widgets .widget.widget_pagelistwidget a:last-child:after {

    content: ” |”;
    }

    Thanks!
    Jennifer

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Jennifer

    (@jdavidson788)

    Still haven’t figured this one out…

    if it isn’t the simple matter of adding a space:

    a:last-child:after{
    content: " | ";
    }
    //--or--
    //you forgot to define what happens before the "|"
    a:last-child:before{
    content: "| ";
    }
    //perhaps the browser doesn't know what to do in this case
    //it most likely will print or 'echo' the next <p> it sees
    //in the stack it won't insert a " " unless you tell it too

    then look at the footer in your browser, right-click to “Inspect element” and determine the source of this missing space… you’ll have to backtrace the stylesheet to the root of the problem, either you’ll be looking at footer.php, style.css, possibly functions.php and you may want to look at the design docs too if you don’t explicity know what each line of script does.

    On “view source, under sources, you can isolate the exact line of code generated by your browser that is producing the unwanted footer text. Most browsers will ID the file (style.css) and which line of the stylesheet is referenced in order to create the bad footer text.

    You can also manually override bad style or unwanted PHP in a “view source” window. Add the space manually to the page’s source and get it to look right. This doesn’t fix the page (only the current instance of it) but in doing so it will help you ID the source of the problem.

    On an aesthetic note, if you want it to look like this:

    Sales | Privacy Policy | Page X | Page Y | Page Last
    Then you’ll need a little extra code to ID “Sales” is the 1st link and “PageLast” is the final link, otherwise the script will make it look like this:
    | Sales | Privacy Policy | PageX | PageY | PageLast | and I’m guessing you don’t want that.

    Thread Starter Jennifer

    (@jdavidson788)

    Thanks for your reply! I’m having a separate issue, which does not allow me to access admin. Once I fix it, I will give this a try and let you know if it works.

    Thread Starter Jennifer

    (@jdavidson788)

    I tried variations of modifying the child code, as you suggested and wasn’t able to override the style. Also, I tried figuring out where exactly the code is defined, but couldn’t figure that out. So, I did a workaround and added a text widget then manually created the links with ” | ” separating each link.

    Thanks again for your help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Break in CSS for Footer Widget’ is closed to new replies.