• Resolved gkp99

    (@gkp99)


    Hi,

    Here’s my index.php file and stylesheet in zip format. The index file is pretty simple. I am trying to target the font size of text found in the “entry” div. I cannot manage to change the size no matter what I do. Even if I wrap the_content() in a span element and target it directly it always ends up size 11 and I can’t work out why. I am just trying to set it to ‘2em’.

    I’m new to CSS and would really appreciate some help. I am sure it is being overwritten somewhere but I can’t figure out where.

    Thanks,

    Garry

Viewing 8 replies - 1 through 8 (of 8 total)
  • You mean ‘entry’ as in the ‘post’ div?

    Did you try altering this guy?

    .post

    ?

    Because that is your post/entry block div.

    Thread Starter gkp99

    (@gkp99)

    There is no post class that’s being used – all the entries are post-long, post-video or post-short.

    Doesn’t seem to make a difference.

    Garry

    Maybe I was/am looking at a totally different site, BUT:

    When I looked at your earlier links, I saw that your posts were classed with .post and then IDed with the appropriate post number.

    Either way, I looked at your zipped files again and there IS a .post so try fixing that.

    <div class="post">
    						<h2>No posts found!</h2>
    					</div>

    Additionally, you use .post-long etc, AND .entry AND .post in your posts if what I am seeing in your index.php is correct.

    Specify the font sizes for ALL of those and the .post and see what happens. If nothing happens and you don’t have any php functions that are interfering with how the CSS is rendering/cascading, I daresay that you are using too many different divs in your posts and the rendering process is being confused.

    Link me to a live page again and I can prove to you that you DO, in fact, have a .post or whatever other classifiers. The page you linked me to earlier surely showed it?

    Thread Starter gkp99

    (@gkp99)

    Thanks for your help so far EMG.

    I have removed the .post class (it was never being used).

    The problem seems to be in <?php the_content() ;?>

    I’ve altered index.php and removed the .entry div. It now reads:

    <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <?php comments_popup_link('{0}', '{1}', '{%}', 'comment-number'); ?>
    <p>Test</p>
    <p><?php the_content(); ?></p>

    In my stylesheet I have the following:

    .post-long p{
    	font-family: helvetica, arial, clean, sans-serif;
    	font-weight: normal;
    	line-height: 1.8em;
    	font-size: 1.3em;
    }

    The word ‘Test’ is formatted correctly but the post content (i.e. what is being supplied by the_content) is not being formatted correctly. When I look at the source of my page (sorry – it’s a local copy) I get this HTML:

    <div class="post-long" id="post-9">					
    
    <h2><a href="https://localhost:80/2009/07/long-post/" title="Long Post">Long Post</a></h2>
    <a href="https://localhost:80/2009/07/long-post/#respond" class="comment-number"  title="Comment on Long Post">{0}</a>
    <p>Test</p>
    <p><p style="text-align: justify; font-size: 11px; line-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 14px; margin-left: 0px; padding: 0px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quis mauris sit amet justo volutpat tincidunt sit amet et mauris. Sed pulvinar lectus eu lectus elementum ultrices quis vel neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Morbi et gravida mi. Fusce tincidunt magna ultricies velit rhoncus ut blandit turpis cursus. Maecenas id lacus lectus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec hendrerit sodales volutpat. Nulla in nunc a tortor tristique luctus vel ac mi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In eget ligula nec risus porta gravida sit amet eu diam. Sed a nisl nec sem tincidunt varius sed id turpis. Fusce venenatis viverra urna, eget pharetra orci convallis vel.</p>
    <p style="text-align: justify; font-size: 11px; line-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 14px; margin-left: 0px; padding: 0px;">Etiam ullamcorper porta nisl, quis elementum risus semper eleifend. Quisque vel quam mauris, vel suscipit elit. Cras feugiat pharetra eros eget volutpat. Vivamus ut arcu est, non viverra diam. Nunc dui arcu, condimentum quis ultricies eu, tempor sed orci. Proin egestas urna eget tellus sollicitudin fringilla. Suspendisse sit amet urna lacus. Vivamus viverra interdum congue. Suspendisse malesuada ligula vel mi faucibus non porta purus placerat. Morbi aliquet elit quis nisl dictum lacinia. Nulla facilisi.</p>
    <p style="text-align: justify; font-size: 11px; line-height: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 14px; margin-left: 0px; padding: 0px;">Donec hendrerit augue sit amet tellus suscipit porta. Fusce massa arcu, auctor nec fermentum vitae, semper sed velit. Aenean eu lectus dolor. Praesent et ante lectus. Proin eget eros vel sem commodo euismod vitae nec dui. Curabitur venenatis metus eget massa varius tempor. Aliquam volutpat, purus nec venenatis luctus, ipsum leo posuere mi, eget euismod mauris ipsum porttitor metus. Phasellus tempus, sapien eleifend ullamcorper faucibus, est augue rhoncus nisl, id interdum turpis elit at elit. Aenean volutpat, magna et volutpat placerat, felis odio suscipit quam, id porttitor nisl odio vel diam. Suspendisse molestie commodo tellus, non venenatis leo ornare in. Donec non magna velit. In suscipit vehicula ultrices. Curabitur erat neque, fermentum in lobortis in, volutpat sit amet lorem. Pellentesque tristique magna a augue posuere auctor.</p>
    </p>
    
    </div>

    It looks like the text from the_content is being styled but I don’t know by what!

    Garry

    is the same code there, if you edit your post in the admin editor – setting html editor?
    and do you get the same ‘css trouble’ for new posts that you enter in the visual editor?
    all this ‘text-align: justify; font-size: 11px; line-height: 14px’-stuff could come from within the text editor, particular if you used some of the formating. (however, this is only a wild guess)

    Thread Starter gkp99

    (@gkp99)

    @alchymyth:

    You are a genius!

    I’m such a doofus – I simply cut-and-paste some filler text into my test blog and the formatting was in the copy & paste.

    Thank you ??

    no problem ??

    I can’t believe I missed that – d’oh!

    For future reference, copying and pasting from a text editor like MS Word or anything that adds additional formatting into the visual editor in WP will need to be ‘cleaned up’.

    If you copy and paste from Word into the plain text/HTML editor (turn off visual editor) you shouldn’t have the same problem.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘CSS font-size problem driving me nuts!’ is closed to new replies.