Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2011
    Posts
    24
    Thanks
    5
    Thanked 0 Times in 0 Posts

    How to make a class that always includes the same nested elements by default?

    So I have an idea, I want to have a class I can call using a shortcode in a theme I am making for wordpress and I want it to always have an image that the text wraps around. A good example would be if I made a class that would be called saying "Did you know?" every time and around that part it allowed you to display text about your little quick fact snippet.

    Basically I want to make a class that has a default image floated to the left so I can always just wrap the text-box content around it, if that makes sense. I have seen this done somehow I just don't know how to do it.

    Thanks for the help in advance!

    Attached is a mock up of what I mean.
    Attached Thumbnails Attached Thumbnails How to make a class that always includes the same nested elements by default?-blockquotemockupidea.jpg  

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,849
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Like
    Code:
    div.myclass{
    padding:5px;
    }
    
    div.myclass img{
    float:left;
    margin:0 5px 5px 0;
    }
    Code:
    <div class="myclass">
    <img src="" .....>
    <p>Paragraph 1</p>
    <p>Paragraph 2...</p>
    </div>
    ?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •