Search
 
 

Display results as :
 


Rechercher Advanced Search

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Latest topics
» NEED TIPS FOR PROGRAMMING AND REDESIGNING WEBSITE
Fri Mar 05, 2010 4:12 pm by JasonBreakey

» Looking For Web Development Service
Wed Dec 30, 2009 5:35 am by Jennifer Clark

» Widget - How do you add them?
Thu Dec 10, 2009 10:00 am by DanaJane

» AVACS LIVE CHAT
Tue Dec 01, 2009 8:01 am by R0mie

» How to Remove the Blogger Top Bar Tip and Hacks
Sat Nov 21, 2009 4:14 pm by cooldude

» Blogger’s Blogspot Top 10 Hacks to Make Your Blog Better
Sat Nov 21, 2009 4:08 pm by cooldude

» Lists of “Top 10” Wordpress plugins around the Internet
Sat Nov 21, 2009 6:06 am by cooldude

» WP Additions - Pagination
Mon Nov 09, 2009 3:42 am by cooldude

» CSS Styling the Header and Footer
Mon Nov 09, 2009 3:40 am by cooldude


Adding Captions For Pictures Using CSS

View previous topic View next topic Go down

20091030

Post 

Adding Captions For Pictures Using CSS




HTML doesn't have an element that allows to insert a figure with a caption.
It was once proposed (see HTML3),
but never made it into HTML4. Here is one way to simulate such a figure
element:
<div class="figure">
<p><img src="eiffel.jpg" width="136"
height="200" alt="Eiffel tower">
<p>Scale model of the
Eiffel tower in Parc Mini-France
</div>

Then in the style sheet you use the class "figure" to
format the figure the way you want. For example, to float the figure to the
right, in a space equal to 25% of the width of the surrounding paragraphs,
these rules will do the trick:
div.figure {
float: right;
width: 25%;
border: thin silver solid;
margin: 0.5em;
padding: 0.5em;
}
div.figure p {
text-align: center;
font-style: italic;
font-size: smaller;
text-indent: 0;
}

In fact, only the first two declarations (float and width) are essential,
the rest is just for decoration.

cooldude
Admin

Posts: 23
Points: 69
Join date: 2009-10-24

View user profile http://sitecrunch.go-board.com

Back to top Go down

Share this post on: Excite BookmarksDiggRedditDel.icio.usGoogleLiveSlashdotNetscapeTechnoratiStumbleUponNewsvineFurlYahooSmarking

Permissions of this forum:
You cannot reply to topics in this forum