Zum Inhalt springen

Css tags

Erstellt am 26. Juni 2006 · 2 Antworten · letzte Antwort am 26. Juni 2006

Tags: Frage

jenny79 ·

Hallo,
habe ein Problem mit meiner Css file:
Ich habe in meiner css, eine defintion namens nav(siehe unten).
in meinem Inhalt, bzw. in meiner HTML Datei habe ich diese Klasse,ID (beides Probiert) nur um mein Hauptmenu.
allerdings wirkt sich die formatireung auf meine anderen Tag auch aus, bsplw. mein Footermenu wird nicht unformatiert dargestellt sondern im BLOCK style und mit border: bottom;
Verstehe ich nicht, denn dieses Menu ist in einem ganz anderen div-tag.

Oder gibt es da bestimmte Vererbungsmechanismen...?
Bis jetzt hatte ich noch nie solche Schwierigkeiten

Lg
Jenny

CSS:

* {
margin: 0;
padding: 0;
border: none; }
body {
background-color: white;
}
a{
color:#666666;
}
/*//////////////////////////////////////////////////////////*/
/*/////////////////////////NAV///////////////////////////////*/
.nav {
/*width: 160px;*/
list-style: none;
background-color: #cbcfd2;
border-top: 1px solid #e5e5e5;
border-right: 1px solid #e5e5e5;
border-left: 1px solid #e5e5e5; }
.nav a,  a:visited{
color:#000000;
font-size: 11px;
font-family: verdana, arial, sans-serif;
text-decoration: none;
display: block;
border-bottom: 1px solid #e5e5e5;
padding: 3px 0 3px 15px; }
.nav a:hover {
background-color: #e5e5e5;
color:#4E4E4E; }
.nav li ul a{
padding-left:20px
}
.nav li ul li a{
}
.nav li ul li ul a{
padding-left:30px;}
.nav li ul li ul li a{
}
/*//////////////////////////////////////////////////////////*/
.link{
color:#999900;
font-size: 11px;
font-family: verdana, arial, sans-serif;
text-decoration: none;
}
.link a{
color:#999900;
font-size: 11px;
font-family: verdana, arial, sans-serif;
text-decoration: none;
}
.pathway {
float:left;
display:inline;
overflow:visible;
}
.nav_pathActive {
float:left;
display:inline;
overflow:visible;
padding: 3px 0 3px 15px;
}
.pathway a,  a:visited{
color:#000000;
font-size: 11px;
font-family: verdana, arial, sans-serif;
text-decoration: none;
border-bottom: 0px solid #e5e5e5;
padding: 3px 0 3px 15px; }
.pathway a:hover {
color:#4E4E4E;;
 }
/*//////////////////////////////////////////////////////////*/
.active a{
background-color: #e5e5e5;
color:#4E4E4E;
}
.active a{
background-color: #e5e5e5;
color:#4E4E4E;
}
.footer a{
float:left;
color:#333333;
font:Arial, Helvetica, sans-serif;
font-size:11px;
}
.footer a:hover {
color:#666666; }

HTML:

<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="#internalStyle" type="text/css"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>Base template, header, menu, content and footer.</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	
	<style type="text/css" id="internalStyle">
		/*<![CDATA[*/
		
		/*]]>*/
	</style>
	
	<link href="fileadmin/template/main/css/css_mod.css" rel="stylesheet" type="text/css" />
	<link href="fileadmin/template/main/css/menu.css" rel="stylesheet" type="text/css" />
	
	<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/ie.css" />
<![endif]-->

</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" id="bg">
<!-- ###DOCUMENT_BODY### start-->
<table id="Table_01" width="999" height="782" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td width="806" height="109" colspan="3" background="fileadmin/template/main/images/header.jpg">
		<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="3"> </td>
 
  </tr>
  <tr>
    <td width="55%" height="19"> </td>
    <td width="22%" id="buttonsection"><img src="fileadmin/template/main/images/ver_b.gif" width="163" height="17" alt="" /></td>
    <td width="23%" id="buttonsection"><img src="fileadmin/template/main/images/pro_b.gif" width="163" height="17" alt="" /></td>
  </tr>
</table>

	  </td>
		<td width="193" height="782" rowspan="2">
			</td>
	</tr>
	<tr>
		<td width="161" height="670" valign="top">
		
		<div id="search">
		###SEARCH###
		
		</div>
		
		
		
		<div id="mainmenu">
		
		<!-- ###MAIN_MENU### start-->
		
		<ul id="nav">
	<li><a href="#">Link1</a></li>
	<li><a href="#">Link2 (act)</a></li>
		<ul>
			<li><a href="#">Link2.2</a></li>
		</ul>
	<li><a href="#">Link3</a></li>
	<ul>
			<li><a href="#">Link3.2</a></li>
		</ul>
	<li><a href="#">Link4</a></li>
	<li><a href="#">Link5</a></li>
	<li><a href="#">Link6</a></li>
</ul>
		<!-- ###MAIN_MENU### stop-->
		
		
		
		</div>
	
		
			</td>
		<td width="459" height="670" valign="top">
			<table width="100%"><tr>
		<td> 
		 ###PATHWAY###  
		
		<!-- ###PFAD### start -->
		
		<!-- ###PFAD### stop -->
		</td></tr><tr>
		
		
		<td id="content" valign="top">
		<!-- ###CONTENT### start -->
		
		<h5>Buy PaperShredder(tm) Gizmo with 30-days money-back guarantee!</h5>
			<img src="fileadmin/template/main/images/paperwork.jpg" width="192" height="156" border="0" alt="" align="right" />
			<p class="bodytext">Adam Seth Enos Cainan Malelehel Iared Enoch Matusale Lamech Noe Sem Ham et Iafeth filii Iafeth Gomer Magog Madai et Iavan Thubal Mosoch Thirasporro filii Gomer Aschenez et Rifath et Thogorma filii autem Iavan Elisa et Tharsis Cetthim et Dodanim.</p>
			<p class="bodytext">Filii Ham Chus et Mesraim Phut et Chanaan filii autem Chus Saba et Evila Sabatha et Rechma et Sabathaca porro filii Rechma Saba et Dadan Chus autem genuit Nemrod iste coepit esse potens in terra Mesraim vero genuit Ludim et Anamim et Laabim et Nepthuim Phethrosim quoque et Chasluim de quibus egressi sunt Philisthim et Capthurim Chanaan vero genuit Sidonem primogenitum et Heth Iebuseum quoque et Amorreum et Gergeseum Evheumque et Aruceum et Asineum Aradium quoque et Samareum et Ematheum filii Sem Aelam et Assur et Arfaxad et Lud et Aram et Us et Hul et Gothor et Mosoch Arfaxad autem genuit Sala qui et ipse genuit Heber porro Heber nati sunt duo filii nomen uni Phaleg quia in diebus eius divisa est terra et nomen fratris eius Iectan Iectan autem genuit Helmodad et Saleph et Asermoth et Iare Aduram quoque et Uzal et Decla Ebal etiam et Abimahel et Saba necnon et Ophir et Evila et Iobab omnes isti filii Iectan Sem Arfaxad Sale Heber Phaleg Raau Serug Nahor Thare Abram iste est Abraham filii autem Abraham Isaac et Ismahel et hae generationes eorum primogenitus Ismahelis Nabaioth et Cedar et Adbeel et Mabsam </p>
			
			<br />
			<!-- ###CONTENT### stop -->
		</td>
</tr></table>
		
		
			</td>
		<td width="186" height="670" id="modules" valign="top">
		<div class="outer_modules">
		<!-- ###MODULETOP### start -->
		
		<!-- ###MODULETOP### stop -->
		
		<!-- ###NEWSLETTER### start -->
		
		
		
		</div>
			</td>
	</tr>
	<tr><td colspan="3">
	<div class="footer_menu">
	<!-- ###FOOTER_MENU### start -->
	 <a href="#" class="footer">Impressum</a> | <a href="#" class="footer">Datenschutz</a> | <a href="#" class="footer">Nutzungsbedingungen</a> | 
	<!-- ###FOOTER_MENU### stop -->
	</div>
	
	</td><td> </td></tr>
</table>
<!-- ###DOCUMENT_BODY### stop -->
</body>
</html>
Unbekannter Benutzer ·

Vererbung von Eigenschaften passiert eigentlich nur nach unten im DOM-Baum. Soweit ich den Code überblicke sollte das hier nicht passieren. Ich sehe eigentlich keinen Grund warum das passiert. Vielleicht testest du mal indem du dein CSS-File auf verschiedene Arten aufbaust und versuchst herauszufinden, ob das an nav liegt.

LineMan ·

ein fehler ist mir aufgefallen...

nicht...

.nav a,  a:visited{
 dein inhalt
}

sondern...

.nav a,  .nav a:visited{
 dein inhalt
}

Dann vererbt sich auch Deine visited Anweisung nicht mehr...

Gruß