Center

Status
Niet open voor verdere reacties.

vlijmenaartjee

Gebruiker
Lid geworden
25 nov 2008
Berichten
32
Als je een site HTML-strict wil maken, mag je geen center gebruiken.
Hoe los ik dit op voor mijn site? Ik heb in de CSS float:center en text-align:center staan.

Nu heb ik in een DIV, een tabel. Buiten de tabel doet ie het gewoon goed, maar binnen de tabel staan de plaatjes en de tekst links. Hoe krijg ik deze in het midden?
 
In line style

<table style="text-align:center;">
of
<td style="text-align:center;">

Foutmeldingen bij w3org kunnen meestal met een inline style opgevangen worden.

:cool:
 
dan weigert hij nog steeds.. Ik gebruik deze code:

HTML:
<table border="2px">
<tr>
<td style="text-align:center; float:center;">
<marquee direction="up" scrollAmount="5" style="width:150px; height:200px; background-color:#000088;">

<a href="http://www.heineken.nl" rel="external">
<img src="heineken.jpg" style="border:0px;" alt="Heineken"/><br />
<strong>Heineken</strong></a><br />

</marquee>
</td>
</tr>
</table>


Nu weet ik dat Marquee niet meer valid is, maar daar zoek ik nog een oplossing voor. Het plaatje en de link onder het plaatje verschijnt nog steeds links in de table.
 
In line style toevoegen.

HTML:
<table border="2px">
<tr>
<td style="text-align:center; ">tekst<br>

<marquee direction="up" scrollAmount="5" style="text-align:center;width:150px; height:200px; background-color:#000088;">

<a href="http://www.heineken.nl" rel="external">
<img src="heineken.jpg" style="border:0px;" alt="Heineken"/><br />
<strong>Heineken</strong></a><br />

</marquee>
</td>
</tr>
</table>

:cool:
 
Valide:

HTML:
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
	<title>(Type a title for your page here)</title>
<!--Pagina gemaakt op Sunday, December 07, 2008 13:37:30 -->
<meta name="GENERATOR" content="Arachnophilia 4.0">
<meta name="FORMATTER" content="Arachnophilia 4.0">
<meta name="description"  content="korte beschrijving van de pagina">
<meta name="keywords"  content="trefwoorden, die, slaan, op, de, pagina">
<meta name="publisher" content="Jan Jansen">
<meta name="Author" content="Peter Vazed">
<meta name="robots" content="index, follow">
<meta name="revisit" content="7 days">
<meta http-equiv=content-type content="text/html; charset=windows-1252">
<meta http-equiv="Content-Style-Type" content="text/css">

<style type="text/css" media="all">
 @import url("zp.css"); 
</style>
		 
<LINK rel="stylesheet" type="text/css" href="zp.css">

 <style type="text/css" media="screen">
 body
{
background-image: url(start-strps.jpg);
margin: 0;
padding: 0;
font-family:  verdana, "comic sans ms", arial, hevetica, sans-serif;
text-align: left;
color: #000;
background: #ffffcc;
}
</style>
</head>

<body >

<table border="2px">
<tr>
<td style="text-align:center;">
<script type="text/javascript">
document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" >');
document.write('<marquee direction="up" scrollAmount="5" style="text-align:center;width:150px; height:200px; background-color:#000088;">');
document.write(' <a href="http://www.heineken.nl" rel="external"><img src="heineken.jpg" style="border:0px;" alt="Heineken"/>');
document.write('<\/marquee>');
document.write('<\/td><\/tr><\/table>');
</script>
</td>
</tr>
</table>


</body>

</html>

:cool:
 
dankje dankje dankje

Nog 1 vraag.. als ik nou meerdere links heb, wordt de code dan:

HTML:
<table border="2px">
<tr>

<td style="text-align:center;">
<script type="text/javascript">
document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" >');
document.write('<marquee direction="up" scrollAmount="5" style="text-align:center;width:150px; height:200px; background-color:#000088;">');
document.write(' <a href="http://www.heineken.nl" rel="external"><img src="heineken.jpg" style="border:0px;" alt="Heineken"/>');
document.write('<\/marquee>');
document.write('<\/td><\/tr><\/table>');
</script>
</td>

<td>
<script type="text/javascript">
document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" >');
document.write('<marquee direction="up" scrollAmount="5" style="text-align:center;width:150px; height:200px; background-color:#000088;">');
document.write(' <a href="http://www.heineken.nl" rel="external"><img src="heineken.jpg" style="border:0px;" alt="Heineken"/>');
document.write('<\/marquee>');
document.write('<\/td><\/tr><\/table>');
</script>
</td>

</tr>
</table>
 
Status
Niet open voor verdere reacties.

Nieuwste berichten

Terug
Bovenaan Onderaan