Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-12-2012, 06:38 PM   PM User | #1
luckydog2011
New Coder

 
Join Date: Oct 2011
Posts: 23
Thanks: 5
Thanked 0 Times in 0 Posts
luckydog2011 is an unknown quantity at this point
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
Click image for larger version

Name:	blockquotemockupidea.jpg
Views:	34
Size:	21.1 KB
ID:	11698  
luckydog2011 is offline   Reply With Quote
Old 11-13-2012, 05:35 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
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>
?
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:28 AM.


Advertisement
Log in to turn off these ads.