Forum Moderators: not2easy
@media print {} should apply CSS suggestions only when someone actually wants to print a page
The image naturally flows to the left side of the container and by placing the text in a div that floats right and let it behave as an inline element it positions itself at the right side of the image.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<title>Wereldwinkel</title>
<meta name="keywords" content="testfile forum">
</head>
<body>
<div id="sample">
<img src="images/homepage.png">
<div id="sample_text">I'm just writing some text here, to show how it will be displayed.</div>
</div>
</body>
<style type="text/css" media="screen">
table {border-collapse:collaspe;}
td {border:1px solid #000; padding: 5px;}
td img {display: block;}
.pics {border: 1px solid #f00;}
.pics img, .pics span {display: inline-block; border: 1px solid #000; vertical-align: middle;}
.pics span {padding: 5px;}
</style>
</head>
<body>
<table summary="product listing">
<tr>
<td><img src="http://www.webmasterworld.com/gfx/logo.png" alt="" width="218" height="112"></td>
<td><p>This is the WebmasterWorld Logo</p><p>The site offers News and Discussion for the Web Professional</p></td>
</tr>
</table>
<hr>
<div class="pics">
<img src="http://www.webmasterworld.com/gfx/logo.png" alt="" width="218" height="112">
<span>This is the WebmasterWorld Logo<br><br>The site offers News and Discussion for the Web Professional</span>
</div>
</body>
<div class="pics">
<img src="http://www.webmasterworld.com/gfx/logo.png" alt="" width="218" height="112">
<div><p>This is the WebmasterWorld Logo</p><p>The site offers News and Discussion for the Web Professional</p></div>
</div>
.pics div {display: inline-block; border: 1px solid #000; vertical-align: middle;}
*.pics div {display: inline;}
You will get this if it's the last thing alt or I do,Definitely not the last - I have future plans involving cups of fair-trade coffee ;)
Whether a page makes sense without CSS code? That's an interesting question. A website obviously should offer me information, it has a function. A car has a function also, it should take me from A to B. I can be taken from A to B in, let's say a Mini Cooper or an Aston Martin, if you let me chose I'll take the Aston Martin.Exactly, and <div>'s are Mini Coopers - quite useful, but they never have the same meaning as an Aston Martin like <p>aragraph, <q>uote, <li>st item ... ;)
<p id="sample">
<img src="images/homepage.png">
I'm just writing some text here, to show how it will be displayed.</p>