Forum Moderators: not2easy
something like:
<div style="background-image:url(img/shader.gif);
background-repeat:repeat-x;">
<div> some text here </div>
</div>
Innumerable options for doing this. One sample is offered below using background-color: to demonstrate. Simply replace with images.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
#wrapper {
background-color: red;
width: 400px;
}#inner {
background-color: teal;
width: 300px;
margin: 1em 50px; 0 1em;
padding: .5em;
}#wrapper, #inner {
border: .1em solid #000;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="inner">
Lorem ipsum dolor sit amet, nulla magna, wisi ut vitae, tellus quis, arcu turpis. Ridiculus ornare pede neque feugiat arcu, eleifend sapien libero. Et neque amet, duis nulla class felis scelerisque eleifend, vel orci facilisis ullamcorper luctus. Nonummy ac gravida eros sociis congue morbi, primis adipiscing neque arcu eleifend, sollicitudin vitae risus pellentesque id dapibus lectus, nibh risus quisque donec molestie enim. Ligula lectus sed ac eleifend, curabitur sociis feugiat, et ultricies turpis nam, sed quis nec fames sit nisl, eget cras augue tincidunt sed. Elementum massa magna viverra, risus adipiscing felis nec vestibulum fusce, libero vehicula maiores, at feugiat nulla sed elit orci.
</div>
</div>
<!--##########-->
</body>
</html>
pseudocode:
* div wrapper with a background image
** inner div with transparent bg, some formatted text here
** other inner div here, transparent bg, other formatted text
* close the divs
Unfortunately the inner divs have a white background that hides the outer div background picture...
<div>
...
floated element in here somewhere
...
<br class="clear" />
</div>
.clear {
clear:both;
}
Or search for "clearfix" it does the same all in CSS, but beware of the hacks most examples come with (you do not need them).
I was told that a parent containing nested float divs should float
I guees this was in reference to the fact that floated elements containing floated children do in fact stretch to encompass their children. But I'd be very careful using that too much as it'll lead to everything being floated.
The problem comes when you need something that floats don't do all that well.