• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Text mittig platzieren -- aber oben !

BDG

Mitglied
hey leute !
hab jetzt seit ca. nem Jahr kein html mehr programmiert aber brauch jetzt ne neue homepage ...
ich habe einen Text den ich immer oben mittig haben will egal wie groß der Browser gerade ist ...
Das mit dem mittig hat so gut funktioniert aber er geht nicht nach oben !
Habs bis jetzt so gemacht :

.Text
{
text-align:center;
}

Wie krig ich den jetzt nach oben ?
 
nein ?! dann ist der Text ja nicht mehr in der Mitte und er verschiebt sich auch nicht mit ...
 
Das Element ist immer so weit oben wie es möglich ist. Falls das bei dir nicht so ist beschreib dein Problem verständlich.
 
ja ich hab da noch was anderes rechts ... da ist das menue ... ich zeig mal den ganzen code :
HTML:
<html>
<head>
    <link rel="stylesheet" type="text/css" href="style.css">
    <title>Meine coole Seite</title>
</head>
<body>
    <body topmargin="2" marginheight="0" marginwidth="0" leftmargin="2">
	<div class="links">
	<img src="animaki.gif" alt="mene ceele anemeten" class="animaki">
	
	 <a href="Index.html"><h3>&emsp;&thinsp;Home </h3></a>
	 <a href="Programme.html"><h3>&thinsp;Programme </h3></a>
	 <a href="Downloads.html"><h3>&ensp;Downloads </h3></a>
	 <a href="Bilder.html"><h3>&emsp;&thinsp;&thinsp;Bilder </h3></a>
	 <a href="Tutorials.html"><h3>&ensp;&thinsp;Tutorials </h3></a>
	 <a href="Impressum.html"><h3>&ensp;Impressum </h3></a>
	</div>
	
	<div class="Text">
	<h1>Wilkommen auf meiner Seite !</h1>
	<h4>Hallo Leute. Dies ist meine Website.<br> Hier könnt ihr meine neusten Spiele und Programme downloaden, 
	</div>
	
</body>
</html>
 
1. Du hast 2 body's
2.
Code:
topmargin=[COLOR=#0000ff]"2"[/COLOR] marginheight=[COLOR=#0000ff]"0"[/COLOR] marginwidth=[COLOR=#0000ff]"0"[/COLOR] leftmargin=[COLOR=#0000ff]"2"[/COLOR]
machst du lieber im CSS so
Code:
*, html
{
  padding:0;
  margin: 2px 0 0 2px;
}
3. Zum Problem:
Ohne die style.css kann man nicht sagen, warum es nicht ganz oben ist.
 
Code:
p {
	  color: red;
	}
	
	body {
background: -moz-linear-gradient(top, rgba(76,252,7,1) 0%, rgba(255,255,255,0) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(76,252,7,1)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(76,252,7,1) 0%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(76,252,7,1) 0%,rgba(255,255,255,0) 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, rgba(76,252,7,1) 0%,rgba(255,255,255,0) 100%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4cfc07', endColorstr='#00ffffff',GradientType=0 ); /* IE6-9 */
background: linear-gradient(top, rgba(76,252,7,1) 0%,rgba(255,255,255,0) 100%); /* W3C */
	}
	
	.animaki 
	{
	border-width: 4px;
	border-style: outset;
	border-color: red;
	
	}
	.links
	{
	border-right: 2px solid #000000;
	height: 310px;
	width: 115px; 
	}
	
	.Text 
	{
	position: fixed;
	top: 1px;
	text-align:center;
	}
	
	
a:link { font-weight:bold; color: black; text-decoration:none; }
a:visited { font-weight:bold; color: #090939; text-decoration:none; }
a:focus { font-weight:bold; color: #999999; text-decoration:underline; }
a:hover { font-weight:bold; color: #E5325E; text-decoration:none; }
a:active { font-weight:bold; color: #6EC6F1; text-decoration:underline; }
 
Für .Text reicht das:
Code:
.Text {
    text-align: center;


}

Musst aber .text vor .links haben
HTML:
<div class="text">
...
</div>
<div class="links">
...
</div>

und wenn du links auch ganz oben haben willst, dann:
Code:
.links {
    border-right: 2px solid #000000;
    [B]float: left;[/B]
    height: 310px;
    width: 115px;


}
 
Zurück
Oben