Need help? Check out our Support site, then


Twenty Eleven: Created "Class" for links - is there a better way?

  1. sensuousinkspiller
    Member

    Hi...

    I'm beginning to learn my way around this CSS, and I know a little information can be dangerous. :-)

    I want to have only the links I add in a post to be a certain color, and be underlined. Not all the links, such as those in the widgets and the dates, categories, tags, etc, for each post. Only a link I add.

    Which meant that:

    <br /> a {<br /> text-decoration: underline;<br /> color: #244fb0;<br /> }<br />

    didn't work for me, since it changed everything.

    I created this class rule and added it:

    <br /> a.blue {<br /> color:#244fb0!important;<br /> text-decoration:underline;<br /> }<br />

    and in a post, I add class="blue" in the html < a > tag. It works! (Which is very exciting, in terms of the learning part.)

    But... before I get too attached to this, will it cause problems later on (other than needing to remember to add the class="blue") or is there a better way?

    Thank you!

    The blog I need help with is sensuousinkspiller.com.

  2. My suggestion on this would be to create a more specific rule that targets only the links in the content of posts and pages and that way you don't have to worry about adding a "class" to each link when you create them. Delete the a.blue you have and give this a try.

    .entry-content a {
    color:#244fb0 !important;
    text-decoration:underline;
    }
  3. ~~thesacredpath
    Happy Friday to you. :)

  4. thesacredpath, nice to see you!!

  5. Happy Friday to you timethief and to all. I'm in countdown mode to happy hour and Hawaiian music.

    @designsimply, thanks and nice to be seen. :-)

  6. @TSP
    It's only 2:00 PM! I'm going to put on some ♫ slack string guitar music ♫ and raise a toast to you after work. :) Aloha

  7. @TT thanks and I'll do the same for you tonight.

  8. @TSP
    Cheers!

  9. sensuousinkspiller
    Member

    Thank you so much, the sacredpath! No remembering needed now - phew!

    I added .comment-content so it does the same in comments, too.

    Being steered in the right direction makes all the difference, thank you all for being so gracious and helpful, not to mention patient.

  10. You are welcome.

Topic Closed

This topic has been closed to new replies.

About this Topic