• Resolved Parwaiz Khan

    (@parwaiz-khan)


    With thanks to rdellconsulting, I need help in styling the links in the body/content area – separately from the global style.

    When, for example, I use:

    a:hover {
    color: #daa520 !important;
    }
    a:visited {
    color: red;
    }

    ‘hover’ element doesn’t work, and the ‘visited’ effects the site title also – site title remains ‘visited’.

    Is there way the style the links in the ‘body/content’ area separately?

    The post in my site contains only the out going links.

    Here is the site: https://newsscouter.com/

    Thank again.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Not sure how you’ve set the page up, but here is one of the a links:
    <a style="text-decoration: none; color:#191970 !important;" href="https://rt.com/usa/237825-us-ambassador-skorea-attacked - Test/" target="_blank" rel="nofollow">US envoy to S. Korea ‘slashed in the face’</a>

    That style= is an inline style which has the highest precedence and will override any other css you add. You should remove those and then use something like:

    .entry-summary .span4 > p > a {
        color: #191970;
    }
    .entry-summary .span4 > p > a:hover {
        color: #DAA520;
    }

    in child theme style.css

    Thread Starter Parwaiz Khan

    (@parwaiz-khan)

    Dave,
    Thank you so much for taking time to look into the source code and guiding me. Couldn’t figure out the pointer to the element (.entry-summary .span) to put the code into the style.css file.

    Put it in style.css,and removed the inline attributes. Every thing is OK, but the “text-align:center;” is not getting implemented.

    Here is what I put in my child-themes’s style.css:

    .entry-summary .span4 > p > a {
    text-align:center !important;
    text-decoration: none;
    color: #191970;
    }
    .entry-summary .span4 > p > a:hover {
    color: #CC0000;
    }
    .entry-summary .span4 > p > a:visited {
    color: #DAA520;
    }

    Any clue? [Though, I can do the centering inline.]

    BTW, I have selected to show the entire content of the post, rather than the excerpts.

    Thank you.

    The a links are centered in FF. Did you refresh your page (Ctl/F5 [Win] or Cmd/F5 [Mac])?

    Thread Starter Parwaiz Khan

    (@parwaiz-khan)

    Yes I did – I work on three different computer simultaneously – same result. centering code via style.css was not working. I ended up doing it inline, though.

    If you can figure it out, please advise. Otherwise, I will just go inline for the centering, and also the color – both of these attributes were not working via style.css.

    Thanks a lot Dave.

    The above code is actually taking precedence, except for color which is superseded by the !important

    I can see precedence:

    Style.css:

    .entry-summary .span4 > p > a {
        text-align: center;
        text-decoration: none;
    }

    Inline:

    element {
        color: #191970 !important;
        font-size: 1.2em;
    }

    Thread Starter Parwaiz Khan

    (@parwaiz-khan)

    Hello Dave,
    I had been, and still am, constantly tinkering with the codes – trying both the css and inline alternately.

    Yes, inline was certainly superseding the css, as it should.

    The color via css is OK now (it worked when I removed the ‘!important’ from the color!). The only thing that I cannot do via CSS is the ‘centering’. I am centering the text inline by styling the ‘p’ element.

    Thank you very much.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Styling Links in the Body section only’ is closed to new replies.