Forums

add div to a text in a post (2 posts)

  1. Alessandro Muraro
    Member
    Posted 11 months ago #

    Hello,

    maybe i'm thick, but i cannot get how to style the text of a post.

    let me explain myself:

    I have
    <?php the_content('Read Full Article'); ?>

    which generates (i'm using Simple Image Size plugin) the following:

    <p><img class="alignleft size-single-post-thumbnail wp-image-75" title="IDL TIFF " src="http://localhost/bibop/assets/PIA01907-1280x800-630x400.jpg" alt="" width="630" height="400" />MY TEXT HERE MY TEXT HERE</p>

    Now, this is fine, but I cannot style the text without affecting the image... is tehre a way to automatically wrap the text in a div so that i can easily style it?

    Alex

  2. Peter vanDoorn
    Member
    Posted 11 months ago #

    In the post editor, click on the HTML tag and you should see basically what you posted above. Immediately either side of the text add <span> tags with a class defined. Then you can create that class in your CSS file.

    EG: ...height="400" />MY TEXT HERE MY TEXT HERE</p> would become: ...height="400" /><span class="myclass">MY TEXT HERE MY TEXT HERE</span></p>

    Hope that helps

    Peter

Reply

You must log in to post.

About this Topic

Tags