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

  • Author
    Posts
  • #878200

    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:


    a {
    text-decoration: underline;
    color: #244fb0;
    }

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

    I created this class rule and added it:


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

    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.

    #878338

    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;
    }
    #878339

    timethief
    Member

    ~~thesacredpath
    Happy Friday to you. :)

    #878340

    thesacredpath, nice to see you!!

    #878366

    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. :-)

    #878369

    timethief
    Member

    @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

    #878377

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

    #878378

    timethief
    Member

    @TSP
    Cheers!

    #878384

    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.

    #878388

    You are welcome.

The topic ‘Twenty Eleven: Created "Class" for links – is there a better way?’ is closed to new replies.