• ke vinritt

    (@ke-vinritt)


    I am trying to style my ‘recent blog posts’ and the style doesn’t seem to be working. If you look on this page (requires login – username: testsite pw: nswd2009)
    I applied style to the links but it’s not showing. Any suggestions on how I can fix this?
    Here’s the PHP I m using to call recent posts:

    <div id="homepage_blog_section_middle">
    <?php
    	if (is_front_page()) {
    ?>
    <ul>
    <?php
    	global $post;
    	$myposts = get_posts('numberposts=3');
    	foreach($myposts as $post) :
    		setup_postdata($post);
    ?>
    	<li><span id="blog_section_date"><?php the_time('m/d/Y'); ?></span><br />
       <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
        <?php the_excerpt(); ?>
    </li>
    <?php endforeach;
    }
    ?>
    </ul>
    </div>

    and here’s the CSS:

    #homepage_blog_section_middle {
    	background-image: url(images/blog_posts_middle.jpg);
    	background-repeat: repeat-y;
    	width: 250px;
    	height: 100%;
    }
    #homepage_blog_section_middle ul {
    	list-style: none;
    	display: block;
    	text-align:left;
    	/*padding-right: 20px;*/
    	padding: 0 20px 0 5px;
    	margin: 0px;
    }
    #homepage_blog_section {
    	background-image: url(images/blog_posts_middle.jpg);
    	background-repeat: repeat-y;
    	width: 250px;
    	height: 100%;
    }
    #homepage_blog_section_middle ul li {
    	list-style: none;
    	text-align:left;
    	padding-top: 5px;
    	border-bottom: dotted 1px #444444;
    }
    #homepage_blog_section_middle li a:link, #homepage_blog_section_middle li a:visited, #homepage_blog_section_middle li a:active, {
    	color: #0B1F47;
    	font-family:"Lucida Grande","Lucida Sans Unicode",Verdana,sans-serif;
    	text-decoration:none;
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m just gonna guess here, cuz I think I see something…(there are other css masters on here who can confirm or correct….)

    You are trying to style links here:

    #homepage_blog_section_middle li a:link, #homepage_blog_section_middle li a:visited, #homepage_blog_section_middle li a:active, {
    	color: #0B1F47;
    	font-family:"Lucida Grande","Lucida Sans Unicode",Verdana,sans-serif;
    	text-decoration:none;
    }

    am I right?

    shouldn’t it be:

    #homepage_blog_section_middle ul li a:link, #homepage_blog_section_middle ul li a:visited, #homepage_blog_section_middle ul li a:active, {
    	color: #0B1F47;
    	font-family:"Lucida Grande","Lucida Sans Unicode",Verdana,sans-serif;
    	text-decoration:none;
    }

    maybe? cuz it looks like in your code we call #homepage_blog_section_middle
    then start an unordered list <ul>

    then have list items <li>

    so the styling would have to be applied to #homepage_blog_section_middle ul li a:link etc….

    I think…..

    Thread Starter ke vinritt

    (@ke-vinritt)

    Thanks RVoodoo – I tried that but it did not work. The li styling should work. I’m guessing I have something wrapped wrong but I do not see it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘css trouble with blog post links’ is closed to new replies.