HTML Zelle verlinken

Jonas123

Ensign
Registriert
Mai 2008
Beiträge
209
Hallo,
ich hab mal wieder ne frage ;)
HTML:
			<table border=0 width=100%>
				<tr>
					<td  valign=center align=center width=25% bgcolor=black>
						<p id=Button><a href=asdf.html>asdf</a></p>
					</td>					
				</tr>
			</table>

Ich möchte bei diesem Code gerne, dass diese ganze Zelle verlinkt wird. Wie kann ich das machen??
2. Frage: Wenn ich in der CSS Datei
Code:
text-decoration: none;
eingebe, dann unterstreicht er mir das trotzdem noch...außerdem habe ich bei
Code:
color: black;
drin, und der link ist trotzdem blau??

Vielen Dank für eure Hilfe!!
Jonas
 
HTML:
<table border="0" width="100%">
	<tr>
		<td  id="blue" style="text-valign=center; width=25%; background-color: black;">
			<a style="text-decoration: none; display: block;" href=asdf.html>asdf</a>
		</td>					
	</tr>
</table>

so in etwa
 
HTML:
<html>
<head>
<title>My Website</title>
</head>

<link rel="stylesheet" type="text/css" href="style.css"> 

<style type="text/css">

</style>

<body bgcolor="orange">
<table border="1" width=100% height=100%>
	<tr>
		<td height=1% valign=center align=center>
			<table border=1 width=100%>
				<tr>
					<td  valign=center align=center >
					</td>
					<td  valign=center align=center width=50% bgcolor=black>
						<p id=Banner>My Website</p>
					</td>	
					<td  valign=center align=center >
					</td>
				</tr>
			</table>
		</td>
	</tr>	
	<tr height=1% border=1>
		<td>
			<table border=1 width=50%>
				<tr>
					<td  id=Button>
						<a id=LinkButton href=asdf.html>asdf</a>
					</td>
					<td id=Button> 
						<a id=LinkButton href=asdf.html>asdf</a>
					</td>						
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td valign=center align=center>
			<p id=Text>
test
			</p>
		</td>
	</tr>
	<tr height=10%>
		<td valign=center align=center>
			
			<hr />
			<table>
				<tr>
					<td>
						<a href=kontakt.html><p id=Link>Kontakt</p></a>
					</td>
					<td>
						
					</td>
					<td>
						<a href=kontakt.html><p id=Link>Impressum</p></a>
					</td>
					<td>
						
					</td>
					<td>
						<a href=links.html><p id=Link>Links</p></a>
					</td>					
				</tr>	
</table>
</body>
</html>

css:
Code:
#Link {
	font-family: Trebuchet MS;
	font-size: 13px;
	color: black;
	text-decoration: none;
}

#Text{
	font-family:Trebuchet MS;
	font-size: 13px;
	color: black;
	text-decoration: none;
}

#Link:hover	{
	font-family:Trebuchet MS;
	font-size: 13px;
	color: white;
	text-decoration: none;
	background: black;
}

#Button {
	font-family:Trebuchet MS;
	font-size: 30px;
	color: orange;
	text-decoration: none;
	background: black;
	display: block;	
}

#Button:hover {
	font-family:Trebuchet MS;
	font-size: 30px;
	color: black;
	text-decoration: none;
	background: orange;
	display: block;
}

#LinkButton {
	text-decoration: none;
	display: block;
}

#Banner {
	font-family:Trebuchet MS;
	font-size: 50px;
	color: orange;
	text-decoration: none;
	background: black;
}

die zwei buttons sind irgendwie untereinander...warum??
danke für eure hilfe!
lg
 
Versuch doch bitte erstmal sauberen Code zu schreiben und überall die Anführungszeichen zu ergänzen und arbeite mit Klassen wenn du mehrere Objekte hast. Die ID ist nur für eine Box vorgesehen!
 
Sorry aber...
was ist daran falsch??
es ist ja nur ein test, und ich möchte einfach wissen, warums nicht funktioniert
wär nett, wenn du mir hlefen würdest =)
lg
 
Auch wenn es nur ein Test ist, kann man es doch gleich richtig machen ;)

Code:
	.button {
		font-family:Trebuchet MS;
		font-size: 30px;
		color: orange;
		text-decoration: none;
		background: black;
	}

	.button a:hover {
		font-family:Trebuchet MS;
		font-size: 30px;
		color: black;
		text-decoration: none;
		background: orange;
	}

	.LinkButton {
		text-decoration: none;
		display: block;
	}

HTML:
<table border="1" width="50%">
	<tr>
		<td class="button"><a class="LinkButton" href="asdf.html">asdf</a></td>
		<td class="button"><a class="LinkButton" href="asdf.html">asdf</a></td>
	</tr>
</table>

Würde dir auch empfehlen das Box-Modell bei selfhtml.org durchzulesen!

Gruß flugser
 
wegen der ganzen zelle zum anklicken mach das doch so:

<td onclick="window.open(this.href, '_blank', '');"><a class="LinkButton" href="asdf.html">asdf</a></td>

dann öffnet sich nun in diesem fall nen neues fenster aber du kannst auch einfach was anderes dort rein schreiben
 
Zurück
Oben