..
An effect that is quite common to see sites and blogs next generation, are written in the so-called overlay over the images, often accompanied by a dark translucent background. Here's an example:

The first thing to do is create an HTML structure like this:
<div class="boximg">
<img border="0" src="tramonto.jpg"/>
<div class="boxtesto">
<span class="testo"> A beautiful sunset! </ span>
</ Div>
</ Div>
As you can see I created a DIV container (with class ". Boximg") within which I position my image and a new div (with class ". Boxtesto") which in turn contains a span that marks the text you want to apply .
Let us now see the CSS that, materially, the work place:
. Boximg {
position: relative;
width: 400px; / * Same width of the image * /
height: 300px; / * The same image height * /
}
{div.boxtesto
position: absolute;
bottom: 0px;
left: 0px;
width: 100%;
background: rgb (0, 0, 0);
background: rgba (0, 0, 0, 0.6);
}
{span.testo
padding: 10px;
color: # FFFFFF;
font: bold 24px/45px Helvetica, Sans-Serif;
letter-spacing:-1px;
}
The storage box (". Boximg") has the same size and relative positioning to the image that is intended to accommodate.
| |
CSS (Course)
Web Design and Accessibility according to W3C CSS and XHTML. Starting from 29 €. |
| |
HTML (Course)
The markup language for the Web from 29 €. |
| |
Webmaster Advanced (Course)
Become a professional Webmaster. From 39 €. |