Zum Inhalt springen

Template Glück auch im Firefox zentriert

Erstellt am 9. Januar 2006 · 13 Antworten · letzte Antwort am 12. Januar 2006

Tags: HTML & CSS, Frage

glasschristian ·

Hi
ich verwende das Tempalte Glück, was im INternetexplorer auch zentriert dargestellt wird, wie ich es im Constant Editor angegeben habe, allerdings wird es im Firefox links ausgerichtet dargestellt.??!
Weiß jemand was ich machen muss

thx

chris

RPW ·
* {
  margin: 0;
  padding: 0;
}

Sollte der obige Eintrag in der der CSS Datei vorhanden sein, entferne diesen Testweise.
Wenn diese nicht hilft versuche den für den <body> Tag folgenden Eintrag in der CSS Datei zu setzen.

body {
  margin-left: 0px;
  margin-top: 0px;
  margin-right: 0px;
  margin-bottom: 0px; 
}
glasschristian ·

hmm. hab alle drei varianten versucht hat aber keine geklappt, wie oben beschrieben im IE zentriert und im firefox leider immer noch rechts.

weiß jemand noch einen rat?

hier die css die ich unter constant editor/template included habe

/* Default stylesheet use in the static template record "cSet stylesheet" */
/* TYPO3 CVS ID: $Id: defaultstylesheet.css,v 1.2 2003/10/26 17:07:43 typo3 Exp $ */

body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}

A:link {
background-color : transparent;
color : navy;
text-decoration : none;
font-weight : bold;
}
A:visited {
background-color : transparent;
color : navy;
font-weight : bold;
text-decoration : none;
}
A:hover {
background-color : transparent;
color : #FF0000;
text-decoration : none;
}
A:active {
background-color : transparent;
color : navy;
font-weight : bold;
text-decoration : none;
}

SELECT {
font-family: Verdana, Arial, Helvetica;
font-size: 10px
}
TEXTAREA {
font-family: Verdana, Arial, Helvetica;
font-size: 10px
}
INPUT {
font-family: Verdana, Arial, Helvetica;
font-size: 10px
}

H1 {
font-family : Verdana, sans-serif;
font-size : 18px;
color : black;
margin-bottom : 0px;
margin-top : 10px;
}
H2 {
font-family : Verdana, sans-serif;
font-size : 15px;
color : #666666;
margin-bottom : 10px;
margin-top : 20px;
}
H3 {
font-family : Verdana, sans-serif;
font-size : 12px;
color : #666666;
margin-bottom : 0px;
margin-top : 10px;
}
H4 {
font-family : Verdana, sans-serif;
font-size : 10px;
color : black;
margin-bottom : 0px;
margin-top : 10px;
}
.subhead1 {
font-family : Verdana, sans-serif;
font-size : 10px;
color : black;
}
.subhead2 {
font-family : Verdana, sans-serif;
font-size : 10px;
color : green;
}
.subhead3 {
font-family : Verdana, sans-serif;
font-size : 10px;
color : red;
}
.headerdate {
font-family : Verdana, sans-serif;
font-size : 10px;
color : Green;
font-weight: normal;
}

P {
font-family : Verdana, sans-serif;
font-size : 11px;
line-height : 180%;
color: #333333;
margin-top : 1px;
margin-bottom : 1px;
padding-bottom : 0px;

}
.caption {
font-family : Verdana, sans-serif;
font-size : 10px;
color : #FF9966;
}
.bulletlist {
font-family : Verdana, sans-serif;
font-size : 10px;
color : #6600CC;
}
.table {
font-family : Verdana, sans-serif;
font-size : 11px;
color : black;
}

.searchform {
font-family : Verdana, sans-serif;
font-size : 12px;
color : #6600CC;
font-weight : normal;
}
.searchresultpagetitle {
font-family : Verdana, sans-serif;
font-size : 15px;
color : #333333;
font-weight : bold;
}
.searchresultcontent {
font-family : Verdana, sans-serif;
font-size : 11px;
color : #6600CC;
font-weight : normal;
}
.searchresultheader {
font-family : Verdana, sans-serif;
font-size : 14px;
color : #333366;
font-weight : bolder;
}
.searchmarkup {
color : #FF0066;
}

.loginform {
font-family : Verdana, sans-serif;
font-size : 14px;
color : #CC0000;
font-weight : normal;
}

.mailform {
font-family : Verdana, sans-serif;
font-size : 12px;
color : #003366;
font-weight : normal;
}
.mailformrequired {
font-family : Verdana, sans-serif;
font-size : 12px;
color : #003366;
font-weight : bolder;
}
.mailformcomment {
font-family : Verdana, sans-serif;
font-size : 12px;
color : #CC0000;
font-weight : bolder;
}
.mailformradio {
font-family : Verdana, sans-serif;
font-size : 10px;
color : #003366;
font-weight : normal;
}

.filelinks {
font-family : Verdana, sans-serif;
font-size : 14px;
color : #990000;
}
.filelinkssize {
font-family : Verdana, sans-serif;
font-size : 14px;
color : Green;
}

.sitemap1 {
font-family : Verdana, sans-serif;
font-size : 12px;
color : #CC6600;
}
.sitemap2 {
font-family : Verdana, sans-serif;
font-size : 11px;
color : #990000;
margin-left : 20px;
}
.sitemap3 {
font-family : Verdana, sans-serif;
font-size : 10px;
color : #333399;
margin-left : 40px;
}
.sitemap4 {
font-family : Verdana, sans-serif;
font-size : 9px;
color : #003333;
margin-left : 60px;
}

.celmenu {
font-family : Verdana, sans-serif;
font-size : 12px;
color : olive;
margin-top : 10px;
}
.celsubmenu {
font-family : Verdana, sans-serif;
font-size : 11px;
color : #666699;
margin-left : 20px;
margin-top : 3px;
}

typo3newbie ·

Hallo glaschristian,

das Zentrierungsproblem läßt sich umgehen, wenn Du den gesamten HTML-Code in einen Container packst, dessen Inhalt zentriert dargestellt werden soll.

Will sagen: Schreib in das Template einfach ein zusätzliches Div-Tag, welches Du im css die Eigenschaft align: center zuweist.

Aussehen tut das dann so:

<body>

<div id="[Bezeichner]">
...
Restlicher Quellcode
...
</div>

</body>

Da man die Ausrichtung der Webseite ja im Allgemeinen nicht ständig ändert, könnte man es auch hardcoden, also direkt im HTML-Code dem Div-Tag die Eigenschaft align="center" zuweisen.

Dafür würde ich nicht lange in typo3 rumdoktern 😉.

Gruß
typo3newbie

glasschristian ·

hilfe, komm echt nicht mehr weiter.
anscheinend ist das template glück irgendwie in der datenbank drin, weiß jemand wie ich da die HTML-Datei finde und verändern kann, oder irgendeine andere Möglichkeit??

oder kann ich die div Container auch irgendwie im Setup oder Constant feld definieren?????

mfg

chris

ttb ·

Nee, die Template-Datei ist unter typo3conf/ext/defaultstatic_tmpl/green/files/ zu finden...wobei dort eigentlich schon

page.bodyTagMargins = 0

drinsteht!?

Für die Zentrierung braucht man auch nicht wirklich ein div.

body { margin: auto; text-align: center; }

reicht vollkommen, damit Fx die Seite zentriert anzeigt.

glasschristian ·

?? bei mir gibt es kein default static unter typo3conf/ext/?? wo kann sie denn noch stecken?
Und ich such das Template Glück nicht Green

Also ich bin in meinem Ordner Projekt3/typo3conf/êxt und habe dort nur ab_minijoboffers; cc_awstats; csh_de; lorem_ipsum; mininews; news_plus; s9_login; th_mailformplus; tt_news; user_photomarathon; user_set_page_title

gruß chris

Unbekannter Benutzer ·

@ ttb...

das text-align:center hat aber nix mit der Zentrierung des Containers zu tun, sondern bezieht sich nur auf den enthaltenen Text...

wenn man eine Angabe width: macht und margin:0px auto; macht, dann wird die Seite zentriert in allen Browsern.
Man sollte das aber nicht im body-Tag einbinden, das ist Blödsinn. Es gehört ein div-Container drumherum wo das drin steht, also zum Beispiel als id...
auch ein div mit align="center" ist gefuscht... Dann hat man ja wieder formatierungen im Quellcode und in die externe CSS kann man ja schließlich align=center nicht reinschreiben, da das HTML ist.

Also den Code in zum Beispiel

<div id="Container-Outside">...</div>

einbinden

und dann in der CSS:

div#Container-Outside { margin: 0px auto; width:980px; }
glasschristian ·

ja das ist gut mit dem div container, doch mein problem ich dfinde die html-datei nicht von dem template glück. unter typo3conf/ext/static... befindet sie sich nicht!??

ttb ·

wenn man eine Angabe width: macht und margin:0px auto; macht, dann wird die Seite zentriert in allen Browsern.

Nein, eben nicht, der IE braucht zusätzlich text-align: center; im body... das margin:auto gehört natürlich ins entsprechende umschließende div.