• Ola!

    I was wondering (I’m fairly certain this is a CSS question) if it’s possible to keep certain text in line with itself, rather than the beginning of the line, without using tables. Here’s what I mean (the bolded text is the writing that I want to keep together, with each line falling directly under the next, not going underneath the unbolded part:

    Start of line – Keep this together

    this website shows what I mean in the right sidebar:

    http://www.andreanott.com/wordpress

    You can see some of the text hangs down underneath the date, which I personally think is a nightmare. I’ve tried using tables but for some reason “Structured Blogging” (the plugin) disagrees with tables when I try to toss a title into a cell.

    So, basically, if there’s a way to do this without tables, either right in the template file itself or in CSS, let me know. If this is not possible, is it possible to limit the number of characters that WordPress shows when I call a post title? That would keep it all on the same line as well.

    Thanks so much for your time, and any ideas to solve this issue will be appreciated immensely. Take care.

    – Adam

Viewing 4 replies - 1 through 4 (of 4 total)
  • Sean

    (@aristophanes)

    Yes you could use CSS, but it may not be so tidy, depending on how you want it to look. The simplest way I guess is to use a div with padding to the left:

    .indented text { padding-left: /* pixel value here */; }

    Where the pixel value for the padding is the distance from the start of the line to the bolded text.

    If the distance from the start of the line to the bolded text is not static and you don’t want to position absolutely, you can use floats, which allow you to position elements relative to eachother without distances.

    So you would put the text ‘Start of line’ in a div with the following property:

    float: left;

    And the rest in one which has:

    float: right;

    You can use the property
    clear: /* none, both, left or right */
    to ‘disallow’ floats on a given side or both. That is, if you use clear: left;, that div will not allow floats on its left side.

    Hope this helps.

    Thread Starter juggernott

    (@juggernott)

    Those are excellent suggestions, thanks for them! My only problem is that I am using Scott’s Customizable Posts Listing plugin – http://www.coffee2code.com/archives/2004/08/27/plugin-customizable-post-listings/ to make the call for the post date and title. Long story short, it won’t allow me to place <div> or <span> tags in the format section. Here’s what the code is:

    <?php c2c_get_recent_posts ($num_posts = 3,
    $format = "<strong>%post_date%</strong> - %post_URL%<br />",
    $categories = '4',
    $orderby = 'date',
    $order = 'DESC',
    $offset = 0,
    $date_format = 'm/d/Y',
    $authors = '',
    $include_passworded_posts = false); ?>

    The function tag allows some code (strong, br, etc.) but won’t allow divs or spans, or I get a parse error.

    I saw on his comments page that there is a way to limit the number of characters in an excerpt by editing the plugin, could this possibly be accomplished in terms of limiting the number of characters returned in the title?

    Hopefully someone might be able to toss in their 2 cents on the matter! Thanks again.

    Thread Starter juggernott

    (@juggernott)

    Does anybody have any knowledge on this??? Please?

    Sean

    (@aristophanes)

    If you want to apply css to output produced by the plugin, you will need to look at the plugin’s php file rather than your index.php or sidebar.php. The relevant code is the segment that starts with

    foreach ($tags as $tag) {

    I’m no programmer but I found that trial and error is usually a pretty straight-forward way of getting things done once you’ve found the source. I hope you achieve the look you’re going for. Let us know how you go:)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘CSS question I guess’ is closed to new replies.