CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   HTML & CSS (http://www.codingforums.com/forumdisplay.php?f=13)
-   -   How to make a class that always includes the same nested elements by default? (http://www.codingforums.com/showthread.php?t=282032)

luckydog2011 11-12-2012 06:38 PM

How to make a class that always includes the same nested elements by default?
 
1 Attachment(s)
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.

abduraooft 11-13-2012 05:35 AM

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>

?


All times are GMT +1. The time now is 09:34 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.