Articles Tutorials Work at Home Entrepreneurs, Webmasters, Small Business Owners
Articles Tutorials Work at Home Entrepreneurs, Webmasters, Small Business Owners
Articles & Tutorials for Work at Home Entrepreneurs
Webmasters and Small Business Owners
Get More >

Newest Articles 
Search Engine Marketing
Internet Marketing
Affiliate Marketing
Email Marketing
Viral Marketing
Webmaster Resources
Business Resources
Make More Money
CSS
Web Design
Graphic Design
Color Theory
Product Reviews
Time Management
Business Ethics
Promotional Strategies
Glossary of Terms
Direct Mail Marketing
Telemarketing
Product Sourcing



Link to Us!

CSS
Email this article  :  Printer friendly page

Text Between Two Images With CSS and Without Tables


Click Here to View Live Example
It is customary using standard HTML to position text between two images using table cells. The table would consist of three cells with the text in the middle cell and the images in the right and left cells. Did you know this can be done with CSS without the use of tables? Get ready, we are stepping a bit beyond the basics of CSS for this article.

Note that our articles refer to "external" CSS because this is the most effective way to develop a web site, and how we design all of our website templates.

If you are not familiar with the different methods of CSS and how or when to use them, be sure to read our article, "External, Internal or Inline? Which Method is Best?"

To accomplish this table-less trick, you simply need to add the custom float style to your external style sheet:
.floatleft {
float: left;
margin-top: 0px;
margin-bottom: 10px;
margin-left: 0px;
margin-right: 10px;
}

.floatright {
float: right;
margin-top: 0px;
margin-bottom: 10px;
margin-left: 10px;
margin-right: 0px;
}

And then assign the custom styles to your image (img) tags:

<img src="images/yourimage1.gif" class="floatleft" width="100" height="50">
<img src="images/yourimage2.gif" class="floatright" width="100" height="50">

Note that I added horizontal and vertical spacing around each image within the custom class by using the margin style. This will allow for adequate room around each image, and will accomplish a wrap around text effect with a margin. The text between the images won't be aligned directly against the images. You can increase the margin size to whatever you feel is appropriate for your project.

Copyright © 1994-2006 by BasicTips.com, a division of BasicTemplates.com, CSS HTML Web Site Templates with Exernal CSS and Removable Graphics. If you found our articles helpful, subscribe to our newsletter and get articles like this delivered to your inbox - FREE.

Order soon and get up to 5 FREE domains & more!
Host 6 Domains on 1 Account
5000MB and 400GB for $6.95 a month!

 

Page copy protected against web site content infringement by Copyscape
All articles are originally authored by BasicTemplates.com. Reprints in whole or in part are not permitted. See Copyright Notice

Copyright © 1994-2006 BasicTips.com, a division of BasicTemplates.com, Web Site Templates with External CSS
The Internet's #1 Choice for HTML CSS Web Templates via a Membership. Designed using External CSS and Removable, Swap-Out Graphics.
Basic Web Templates | Website Templates | HTML CSS Templates | Web Design Templates | Web Site Templates