Need help? Check out our Support site, then


Question about CSS

  1. Thanks to all the wonderful help I've received here, I've been making a lot of changes to my blog and picking up some useful CSS tips. I have a question about what is more efficient and "correct" as far as CSS code goes.

    So, I received the following code because I wanted my post titles on my home page to be above the thumbnails:

    .entry-title {
    display:block;
    position:absolute;
    left:0;
    overflow:hidden;
    height:30px;
    width:550px;
    white-space:nowrap;
    }

    Then I was given the following code so my titles and posts wouldn't overlap:

    .home .entry-thumbnail,.home .entry-content {
    display:block;
    padding-top:43px;
    }

    Today I noticed that the titles and content of my Archives and Pages were still overlapping, and I was able to modify the above code and fix it myself.

    body.page .entry-content {
    display:block;
    padding-top:43px;
    }

    .archive .entry-thumbnail,.archive .entry-content {
    display:block;
    padding-top:43px;
    }

    So my question for today is, is there a way to combine all three of the last pieces of code so that it's just one? Is is "better" to have it as one or does it not make a difference?

    I ask because I have a bunch of what I think will be global changes to make to my CSS, such as changing the Archives titles and Widget titles to be the same as the post titles, and I wasn't sure if I could just add the various selectors to one bit of code or if I have to write the same code over and over with the different selectors or whatever.

    Thanks!!

    The blog I need help with is notchangingmyname.com.

  2. Hi there,
    I don't help with CSS editing. Aside from Staff support for CSS editing, which is usually provided by designsimply, from time to time thesacredpath, a Volunteer helps too. I see that he is on the forum now and I'll bump this thread in the hope that he will respond to you.

  3. You can combine them. You can also have them separate, it doesn't really matter, but you'll have just one place to look for the value if you want to change it to 46px or something in the future. Think of it this way - you can email one email to three different people, three different times, or you can email them once all at the same time. As long as all three are getting the exact same message, you can specify them all at once. Separate with commas.

    .home .entry-thumbnail, .home .entry-content body.page .entry-content,  .archive .entry-thumbnail, .archive .entry-content {
    display:block;
    padding-top:43px;
    }
  4. Thanks! Much appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic