Forums

[resolved] changing the link color in a post (19 posts)

  1. jvazjr
    Member
    Posted 4 months ago #

    how can i change the color of the link in my post??

    also, how can i make that link open in a new window?

  2. dbmartin
    Member
    Posted 4 months ago #

    Changing the color of a link is done via your CSS style sheet.

    There are several ways to make links open in new windows. I just wrote a tutorial on my blog about using jQuery to open external links in a new window. You can check it out here if you'd like.

  3. jvazjr
    Member
    Posted 4 months ago #

    where in the style sheet

  4. jvazjr
    Member
    Posted 4 months ago #

    that link you gave me is way too confusing

  5. jvazjr
    Member
    Posted 4 months ago #

    where is the help???

  6. dbmartin
    Member
    Posted 4 months ago #

    In your style sheet look for a:link, a:visited, a:hover, a:active.

    As for the tutorial, it takes you step by step and explains everything.

    If you'd rather just hack the links to get them to open in a new window and don't care about being standards-compliant, then you can just add target="_blank" to your links like so:

    <a href="url_of_link" target="_blank" title="title of link">link text</a>

  7. jvazjr
    Member
    Posted 4 months ago #

    for the color change,where do i find the info to edit??

    you said a:link, a:visited, a:hover, a:active???

  8. jvazjr
    Member
    Posted 4 months ago #

    i dont see anything like this in the content area

  9. jvazjr
    Member
    Posted 4 months ago #

    here is my blog

    jvazjrsblog.com

  10. dbmartin
    Member
    Posted 4 months ago #

    You have to look in your CSS stylesheet; your style.css file. Your links are currently set to:

    a {
      color: #727248;
      text-decoration: none;
      }
    
    a:hover {
      color: #727248;
      text-decoration: underline;
      }

    In your WP Dashboard left navigation menu open the built-in file editor (Appearance » Editor) and choose your CSS stylesheet to edit. Scroll until you see the code I typed above and change the color to whatever you want.

  11. jvazjr
    Member
    Posted 4 months ago #

    change it for both?

  12. jvazjr
    Member
    Posted 4 months ago #

    this will only change the links in the posts right?

  13. dbmartin
    Member
    Posted 4 months ago #

    No, it will change all links because you don't have links within posts styled separately from other links. If you only want links within the post content to be changed then you need to add the following to your stylesheet:

    .postContent a {
      color: #whatever color you want;
      text-decoration: none;
      }
    
    .postContent a:hover {
      color: #whatever color you want;
      text-decoration: underline;
      }
  14. jvazjr
    Member
    Posted 4 months ago #

    add both correct??

  15. jvazjr
    Member
    Posted 4 months ago #

    where do i add them?

  16. dbmartin
    Member
    Posted 4 months ago #

    In your WP Dashboard left navigation menu open the built-in file editor (Appearance ยป Editor) and choose your CSS stylesheet to edit.

  17. jvazjr
    Member
    Posted 4 months ago #

    i know that part

    where do i add that code in the style sheet?

  18. jvazjr
    Member
    Posted 4 months ago #

    well?

  19. jvazjr
    Member
    Posted 4 months ago #

    can anyone else help me??

Reply

You must log in to post.

About this Topic

Tags

No tags yet.