Faire une recherche
Poster ici pour un problème sans avoir cherché sur un moteur de recherche est fortement déconseillé, comme partout.
Lire les références des langages :Lire les guides :Valider son code
- la validateur HTML du W3C : ça corrige pas forçément les erreurs, mais ça permet de corriger les balises mal fermées, etc.
- le validateur CSS du W3C : comme pour le HTML, ça résoud pas le problème, mais ça peut aider
- le validateur Atom ou RSS du W3C : idem
- Typetester : pour tester les polices (merci The_Spacecowboy)
- Browsershots : pour tester un site avec différents navigateurs (merci Knep)
N'oubliez pas d'enlever les espaces entre les crochets et de fermer les balises, comme ceci : [mabalise]mon texte[/mabalise]
Si c'est du HTML : la balise [ html ] :
<!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" lang="fr">
<head>
<title>cafzone.net powaa</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1;" />
<script language="JavaScript" type="text/javascript">
<!--
function ChangeMessage(id) {
document.getElementById('hidden'+id).style.display='inline';
document.getElementById('lien'+id).style.display='none';
}
//-->
</script>
</head>
<body>
<h1>zog</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam vestibulum interdum augue. Quisque luctus odio nec enim. Nulla facilisi. Integer nulla lorem, mattis et, sollicitudin vitae, facilisis sit amet, est. Aliquam tristique. Proin suscipit tellus quis metus. Nulla dolor turpis, tempus vel, vestibulum quis, pharetra non, arcu. Morbi facilisis sem vitae erat. In malesuada odio vel magna. Cras eget justo. Nunc pellentesque.</p>
</body>
</html>
Les exemples suivants viennent de php.net.
Pour le code, la balise [ code ] :
<?php
$left = 0;
$top = 0;
$x_size = 400;
$y_size = 400;
$char_width = 8;
$char_height = 11;
$x_start = $x_left + 100;
$y_start = $top + $char_height * 1.5;
$x_end = $x_start + $x_size;
$y_end = $y_start + $y_size;
$right = $x_start + $x_size + 40;
$bottom = $y_start + $y_size + $char_height * 1.5;
$graph_n = 100;
for($i = 0; $i < $graph_n; $i++ )
{
$graph_x[$i] = $i;
$graph_y[$i] = $i * $i;
}
$min_x = 9e99;
$min_y = 9e99;
$max_x = -9e99;
$max_y = -9e99;
$avg_y = 0.0;
for($i = 0; $i < $graph_n; $i++ )
{
if( $graph_x[$i] < $min_x )
$min_x = $graph_x[i];
if( $graph_x[$i] > $max_x )
$max_x = $graph_x[$i];
if( $graph_y[$i] < $min_y )
$min_y = $graph_y[$i];
if( $graph_y[$i] > $max_y )
$max_y = $graph_y[$i];
$avg_y += $graph_y[$i];
}
$avg_y = $avg_y / $graph_n;
$min_x = 0;
$min_y = 0;
$max_x += $max_x * 0.05;
$max_y += $max_y * 0.05;
$image = ImageCreate($right - $left, $bottom - $top);
$background_color = imagecolorallocate($image, 255, 255, 255);
$text_color = imagecolorallocate($image, 233, 14, 91);
$grey = ImageColorAllocate($image, 204, 204, 204);
$white = imagecolorallocate($image, 255, 255, 255);
$black = imagecolorallocate($image, 0, 0, 0);
$red = imagecolorallocate($image, 255, 0, 0);
imagerectangle($image, $left, $top, $right - 1, $bottom - 1, $black );
imagerectangle($image, $x_start, $y_start, $x_end, $y_end, $grey );
for($i = 0; $i < $graph_n; $i++ )
{
$pt_x = $x_start + ($x_end-$x_start)*($graph_x[$i]-$min_x)/($max_x-$min_x);
$pt_y = $y_end - ($y_end - $y_start)*($graph_y[$i]-$min_y)/($max_y-$min_y);
// imagesetpixel( $image, $pt_x, $pt_y, $black );
imagechar($image, 2, $pt_x - 3, $pt_y - 10, '.', $black);
}
$string = sprintf("%2.5f", $max_y);
imagestring($image, 4, $x_start - strlen($string) * $char_width, $y_start - $char_width, $string, $black);
$string = sprintf("%2.5f", $min_y);
imagestring($image, 4, $x_start - strlen($string) * $char_width, $y_end - $char_height, $string, $black);
$string = sprintf("%2.5f", $min_x);
imagestring($image, 4, $x_start - (strlen($string) * $char_width)/2, $y_end, $string, $black);
$string = sprintf("%2.5f", $max_x);
imagestring($image, 4, $x_end - (strlen($string) * $char_width) / 2, $y_end, $string, $black);
$x_title = 'x axis';
$y_title = 'y axis';
imagestring($image, 4, $x_start + ($x_end - $x_start) / 2 - strlen($x_title) * $char_width / 2, $y_end, $x_title, $black);
imagestring($image, 4, $char_width, ($y_end - $y_start) / 2, $y_title, $black);
header('Content-type: image/png');
$filename = sprintf("%d.png", time());
ImagePNG($image,$filename);
ImageDestroy($image);
printf("<img src='%s'> ", $filename);
?>
N'hésitez pas à poster pour ajouter des infos, remarques, etc.
Modifié par Moe, 19 March 2007 - 20:04.












Retour en haut







