WordPress.org

Ready to get started?Download WordPress

Forums

Editor unable to handle floating side-by-side elements cleanly (4 posts)

  1. davehprohoods
    Member
    Posted 1 year ago #

    We're trying to put a multiple product descriptions on a page, with an image on the left and a varied description to the right (meaning the height could extend beyond the image based on the text), but WordPress just throws everything in Paragraph tags and doesn't clear the floats ever. Typically I would do something like this:

    <div>
    <p style="float: left">image</p>
    <p style="float: left">description</p>
    </div>
    <div style="clear: both"></div>

    However WordPress doesn't seem to have any ability to do this. Is there any recommendation on this?

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Try separating your styles out externally so that you do not deal with them through the editor.

  3. Andrew
    Forum Moderator
    Posted 1 year ago #

    but WordPress just throws everything in Paragraph tags

    Not everything. WordPress enforces semantic HTML by throwing inline elements into block elements where necessary.

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    You may want to create a custom post type
    http://codex.wordpress.org/Post_Types#Custom_Post_Types

    And then query that post type
    http://codex.wordpress.org/Post_Types#Querying_by_Post_Type

    To spit out a particular HTML structure

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.