KOMPOOS.NL

automatic caption CSS

home » css » image-effects » automatic-caption.html

sitemap


voorbeeld automatic caption

automatische caption DEMO van automatische caption.

uitleg van de procedure

Om een afbeelding van een automatische caption te voorzien moet je de stylesheet, die hieronder staat, in de head-sectie van jouw pagina plaatsen. Verder staan er een paar regels met "voorbeeld-code" hieronder. Je kan eenvoudig de CSS aanpassen aan jouw eigen wensen. De "tint" (die nu op color:#fdd; staat) is daar een voorbeeld van. Ook de hoogte van de caption ten opzichte van de afbeelding is makkelijk met de "height" (zie .automatische_caption a:hover te wijzigen. Als je de tekst rechts van de afbeelding door wilt laten lopen, hoef je alleen maar de <p> tag met de class "clear_caption" weg te laten. De opbouw van de caption is makkelijk. Alle tekst die in de span "auto-caption" staat wordt bij een hover over het plaatje getoond. De tekst die tussen de <strong> staat zal als "kopje" behandeld worden.

html voorbeeld code auto-caption


<p class="automatische_caption">
	<a href="http://kompoos.nl/css/image-effects/automatic-caption.html"><img width="180" height="272" src="http://static.dns5.nl/automatische-caption.jpg" alt="automatische caption" />
	<span class="auto_caption"><strong>DEMO</strong>van automatische caption.</span></a>
</p>
<p class="clear_caption"></p>

stylesheet van de automatische caption


<style type="text/css">
	.automatische_caption{
		overflow:hidden;
		float:left;
		position:relative}
	.automatische_caption a{
		text-decoration:none}
	.automatische_caption a:hover{
		cursor: pointer}
	.automatische_caption a img{
		margin:0;
		border:none;
		padding:0px;}
	.automatische_caption a .auto_caption{
		display:none}
	.automatische_caption a:hover .auto_caption{
		display:inline-block;
		width:100%;
		height:40%;
		font-size:0.9em;
		color:#fdd;
		background:#511;
		filter:alpha(opacity=70);
		opacity:.70;
		-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; 
		position:absolute;
		bottom:4px;
		left:0px;
		padding:1em}
	.automatische_caption a:hover .auto_caption strong{
		display:block;
		font-size:1.3em}
	.clear_caption{
		clear:both}
</style>
Gebruik voor alle voorbeelden op de http://kompoos.nl een valide html5 pagina.