Einzelnen Beitrag anzeigen

Benutzerbild von nailor
nailor

Registriert seit: 12. Dez 2002
Ort: Karlsruhe
1.989 Beiträge
 
#1

[CSS] Eingebettet versus Extern

  Alt 10. Jul 2005, 23:20
Ich habe eine phpBB-Template-Datei. Da steht folgendes drin:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{S_CONTENT_DIRECTION}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}">
<meta http-equiv="Content-Style-Type" content="text/css">
{META}
{NAV_LINKS}
<title>{SITENAME} :: {PAGE_TITLE}</title>
<style type="text/css">
<!--
/*
  The original Jenova Theme for phpBB version 2+
  Created by Digital-delusion design
  [url]http://www.digital-delusion.com[/url]

  NOTE: These CSS definitions are stored within the main page body so that you can use the phpBB2
  theme administration centre. When you have finalised your style you could cut the final CSS code
  and place it in an external file, deleting this section to save bandwidth.
*/

/* General page style. The scroll bar colours only visible in IE5.5+ */
body { 
   background-color: #E5E5E5;
        font-size: 11px;
   color: #626769;
   margin-left: 0px;
   margin-top: 0px;
   margin-right: 0px;
   margin-bottom: 0px;
   scrollbar-face-color: #EDEDED;
   scrollbar-highlight-color: #A7B1B5;
   scrollbar-shadow-color: #A7B1B5;
   scrollbar-3dlight-color: #EDEDED;
   scrollbar-arrow-color: #A7B1B5;
   scrollbar-track-color: #e5e5e5;
   scrollbar-darkshadow-color: #EDEDED;
}

/* General font families for common tags */
font,th,td,p { font-family: Geneva, Arial, Helvetica, sans-serif; }
a:link,a:active,a:visited { text-decoration: underline; color : #626769; }
a:hover      { text-decoration: none; color : #5B97B1; }
hr   { height: 0px; border: solid #A7B1B5 0px; border-top-width: 1px;}

/* This is the border line & background colour round the entire page */
.bodyline   { background-color: {T_TD_COLOR2}; border: 1px {T_TH_COLOR1} solid; }

/* This is the outline round the main forum tables */
.forumline   { background-color: #E5E5E5; border: 2px #A7B1B5 solid; }

/* Main table cell colours and backgrounds */
td.row1   { background-color: #EDEDED; border: solid 1px #A7B1B5;}
td.row2   { background-color: #E5E5E5; border: solid 1px #A7B1B5; }
td.row3   { background-color: {T_TR_COLOR3}; }

/*
  This is for the table cell above the Topics, Post & Last posts on the index.php page
  By default this is the fading out gradiated silver background.
  However, you could replace this with a bitmap specific for each forum
*/
td.rowpic {
      background-color: {T_TD_COLOR2};
      background-image: url(templates/subSilver/templates/Jenova/images/{T_TH_CLASS3});
      background-repeat: repeat-y;
}

/* Header cells - the blue and silver gradient backgrounds */
th   {
        font-size: 11px;
   font-weight: bold;
   color: #e2e2e2;
   background-color: #A7B1B5;
}

td.cat,td.catHead,td.catSides,td.catLeft,td.catRight,td.catBottom {
         background-color: #C1C7C9; border: {T_TH_COLOR3}; border-style: solid; height: 28px;
}

/*
  Setting additional nice inner borders for the main table cells.
  The names indicate which sides the border will be on.
  Don't worry if you don't understand this, just ignore it :-)
*/
td.cat,td.catHead,td.catBottom {
   height: 29px;
   border-width: 0px 0px 0px 0px;
}
th.thHead,th.thSides,th.thTop,th.thLeft,th.thRight,th.thBottom,th.thCornerL,th.thCornerR {
   font-weight: bold; border: {T_TD_COLOR2}; border-style: solid; height: 28px;
}
td.row3Right,td.spaceRow {
   background-color: #CACDD0; border: {T_TH_COLOR3}; border-style: solid;
}

th.thHead,td.catHead { font-size: {T_FONTSIZE3}px; border-width: 0px 0px 0px 0px; }
th.thSides,td.catSides,td.spaceRow    { border-width: 0px 0px 0px 0px; }
th.thRight,td.catRight,td.row3Right    { border-width: 0px 0px 0px 0px; }
th.thLeft,td.catLeft     { border-width: 0px 0px 0px 0px; }
th.thBottom,td.catBottom { border-width: 0px 1px 1px 1px; }
th.thTop    { border-width: 0px 0px 0px 0px; }
th.thCornerL { border-width: 0px 0px 0px 0px; }
th.thCornerR { border-width: 0px 0px 0px 0px; }

/* The largest text used in the index page title and toptic title etc. */
.maintitle   {
   font-weight: bold; font-size: 22px; font-family: "{T_FONTFACE2}",{T_FONTFACE1};
   text-decoration: none; line-height : 120%; color : #626769;
}

/* General text */
.gen { font-size : {T_FONTSIZE3}px; }
.genmed { font-size : {T_FONTSIZE2}px; }
.gensmall { font-size : {T_FONTSIZE1}px; }
.gen,.genmed,.gensmall { color : #626769; }
a.gen,a.genmed,a.gensmall { color: #5B97B1; text-decoration: none; }
a.gen:hover,a.genmed:hover,a.gensmall:hover   { color: #006699; text-decoration: none; }

/* The register, login, search etc links at the top of the page */
.mainmenu      { font-size : {T_FONTSIZE2}px; color : {T_BODY_TEXT} }
a.mainmenu      { text-decoration: none; color : #5B97B1; }
a.mainmenu:hover{ text-decoration: none; color : #006699; }

/* Forum category titles */
.cattitle      { font-weight: bold; font-size: {T_FONTSIZE3}px ; letter-spacing: 1px; color : #5B97B1;}
a.cattitle      { text-decoration: none; color : #5B97B1; }
a.cattitle:hover{ text-decoration: underline; }

/* Forum title: Text and link to the forums used in: index.php */
.forumlink      { font-weight: bold; font-size: {T_FONTSIZE3}px; color : {T_BODY_LINK}; }
a.forumlink    { text-decoration: none; color : #5B97B1; }
a.forumlink:hover{ text-decoration: none; color : #006699; }
a.forumlink:visited{ text-decoration: none; color : #5B97B1; }

/* Used for the navigation text, (Page 1,2,3 etc) and the navigation bar when in a forum */
.nav         { font-weight: bold; font-size: {T_FONTSIZE2}px; color : #626769;}
a.nav         { text-decoration: none; color : #5B97B1; }
a.nav:hover      { text-decoration: none; color : #006699; }
a.nav:visited      { text-decoration: none; color : #5B97B1; }

/* titles for the topics: could specify viewed link colour too */
.topictitle,h1,h2   { font-weight: bold; font-size: {T_FONTSIZE2}px; color : #626769; }
a.topictitle:link  { text-decoration: none; color : #5B97B1; }
a.topictitle:visited { text-decoration: none; color : #5B97B1; }
a.topictitle:hover   { text-decoration: none; color : #006699; }

/* Name of poster in viewmsg.php and viewtopic.php and other places */
.name         { font-size : {T_FONTSIZE2}px; color : {T_BODY_TEXT};}

/* Location, number of posts, post date etc */
.postdetails      { font-size : {T_FONTSIZE1}px; color : {T_BODY_TEXT}; }

/* The content of the posts (body of text) */
.postbody { font-size : {T_FONTSIZE3}px; line-height: 18px}
a.postlink:link   { text-decoration: none; color : #5B97B1 }
a.postlink:visited { text-decoration: none; color : #5B97B1; }
a.postlink:hover { text-decoration: none; color : #006699 }

/* Quote & Code blocks */
.code { 
   font-family: Courier; font-size: 11px; color: #006699;
   background-color: #F5F6F7; border: {T_TR_COLOR3}; border-style: solid;
   border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px
}

.quote {
   font-family: {T_FONTFACE1}; font-size: {T_FONTSIZE2}px; color: #626769; line-height: 125%;
   background-color: {T_TD_COLOR1}; border: {T_TR_COLOR3}; border-style: solid;
   border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px
}

/* Copyright and bottom info */
.copyright      { font-size: {T_FONTSIZE1}px; font-family: {T_FONTFACE1}; color: {T_FONTCOLOR1}; letter-spacing: -1px;}
a.copyright      { color: #626769; text-decoration: underline;}
a.copyright:hover { color: #5B97B1; text-decoration: none;}

/* Form elements */
input,textarea, select {
        font-size: 12px;
   color: #828A8D;
   font-family: Geneva, Arial, Helvetica, sans-serif;
   background-color: #C7CED0;
   border: 1px solid #939B9E;
}

/* The text input fields background colour
input.post, textarea.post, select {
   background-color : {T_TD_COLOR2};
} */

input { text-indent : 2px; }

/* The buttons used for bbCode styling in message post */
input.button {
   background-color : {T_TR_COLOR1};
   color : {T_BODY_TEXT};
   font-size: {T_FONTSIZE2}px; font-family: {T_FONTFACE1};
}

/* The main submit button option
input.mainoption {
   background-color : {T_TD_COLOR1};
   font-weight : bold;*/
}

/* None-bold submit button
input.liteoption {
   background-color : {T_TD_COLOR1};
   font-weight : normal;
}*/

/* This is the line in the posting page which shows the rollover
  help line. This is actually a text box, but if set to be the same
  colour as the background no one will know ;)
*/
.helpline { background-color: #C7CED0 border solid 1px #939B9E; }

/* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */
@import url("templates/Jenova/formIE.css");
.text {   font-family: Geneva, Arial, Helvetica, sans-serif;
   font-size: 10px;
   color: #828A8D;
   background-color: #C7CED0;
   border: 1px solid #939B9E;
}
A.catlink {
   font-size: 11px;
   font-weight: bold;
   color: #5B97B1;
   text-decoration: none;
}
A.catlink:visited {
   font-size: 11px;
   font-weight: bold;
   color: #5B97B1;
   text-decoration: none;
   }
   .A.catlink:active {
   font-size: 11px;
   font-weight: bold;
   color: #5B97B1;
   text-decoration: none;
   }
A.catlink:hover {
   font-size: 11px;
   font-weight: bold;
   color: #006699;
   text-decoration: none;
}
.catty {
   font-size: 11px;
   font-weight: bold;
   color: #e2e2e2;
   }
.head {
        font-size: 11px;
   font-weight: bold;
   color: #e2e2e2;
   background-color: #A7B1B5;
   }
-->
</style>

<script language="Javascript" type="text/javascript">
<!--
   if ( {PRIVATE_MESSAGE_NEW_FLAG} )
   {
      window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
   }
//-->
</script>

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onLoad="MM_preloadImages('templates/Jenova/images/main2.gif', 'templates/Jenova/images/search2.gif', 'templates/Jenova/images/faq2.gif', 'templates/Jenova/images/members2.gif', 'templates/Jenova/images/groups2.gif', 'templates/Jenova/images/profile2.gif', 'templates/Jenova/images/pms2.gif')">
<TABLE width="100%" cellspacing="0" cellpadding="0">
  <TR>
    <TD width="1%" align="left" background="templates/Jenova/images/head_r1_c2.gif">[img]templates/Jenova/images/head_r1_c1.gif[/img]</TD>
    <TD width="12%" align="center" valign="top" background="templates/Jenova/images/head_r1_c2.gif"><TABLE width="100%" height="82" cellpadding="0" cellspacing="0">
      <TR>
        <TD height="52" valign="top"><A name="top"></A></TD>
      </TR>
      <TR>
        <TD align="left"><TABLE width="100%" cellspacing="0" cellpadding="0">
            <TR align="center">
              <TD>[url="{U_INDEX}"][img]templates/Jenova/images/main1.gif[/img][/url]</TD>
              <TD>[url="{U_SEARCH}"][img]templates/Jenova/images/search1.gif[/img][/url]</TD>
            </TR>
        </TABLE></TD>
      </TR>
    </TABLE></TD>
    <TD width="5%" align="right" background="templates/Jenova/images/head_r1_c2.gif">[img]templates/Jenova/images/head_r1_c4.gif[/img]</TD>
    <TD width="48%" align="center" valign="top" background="templates/Jenova/images/head_r1_c5.gif"><TABLE width="94%" cellspacing="0" cellpadding="0">
      <TR>
        <TD height="72" align="center" valign="top">[url="{U_INDEX}"][img]templates/Jenova/images/logo.gif[/img][/url]</TD>
      </TR>
      <TR>
        <TD></TD>
      </TR>
    </TABLE></TD>
    <TD width="5%" align="left" background="templates/Jenova/images/head_r1_c8.gif">[img]templates/Jenova/images/head_r1_c7.gif[/img]</TD>
    <TD width="28%" align="center" valign="top" background="templates/Jenova/images/head_r1_c8.gif"><TABLE width="100%" height="80" cellpadding="0" cellspacing="0">
      <TR>
        <TD height="51"></TD>
      </TR>
      <TR>
        <TD><TABLE width="100%" height="23" cellpadding="0" cellspacing="0">
            <TR align="center" valign="middle">
              <TD>[url="{U_FAQ}"][img]templates/Jenova/images/faq1.gif[/img][/url]</TD>
              <TD>[url="{U_MEMBERLIST}"][img]templates/Jenova/images/members1.gif[/img][/url]</TD>
              <TD>[url="{U_GROUP_CP}"][img]templates/Jenova/images/groups1.gif[/img][/url]</TD>
              <TD>[url="{U_PROFILE}"][img]templates/Jenova/images/profile.gif[/img][/url]</TD>
              <TD>[url="{U_PRIVATEMSGS}"][img]templates/Jenova/images/pms1.gif[/img][/url]</TD>
            </TR>
        </TABLE></TD>
      </TR>
    </TABLE></TD>
    <TD width="1%" align="right" background="templates/Jenova/images/head_r1_c8.gif">[img]templates/Jenova/images/head_r1_c10.gif[/img]</TD>
  </TR>
</TABLE>
man beachte die auskommentierten CSS-Befehle. Nutze ich es so, klappt alles wunderbar. Mache ich den ganzen Kommentar mit dem CSS drin weg, geht nichts mehr. Lagere ich den ganzen Kram (wie empfohlen) in eine externe Datei aus und bennene sie falsch, geht auch nichts (klaro). Und nun kommts: benenne ich die Datei richtig um klappt etwas. Die Farben stimmen, aber die Schriftarten/größen... sind sehr anders als erwartet.

Ich kapier erstens nicht, warum ausgeklammerter CSS-Code geht und zweitens warum es einen Unterschied macht, ob der in der Datei steht oder in einer externen CSS-Datei.

[edit=alcaeus]Code formatiert damit es keine Scrollbars gibt. Mfg, alcaeus[/edit]
Michael N.
http://nailor.devzero.de/code/sharpmath/testing/ --- Tests, Feedback, Anregungen, ... aller Art sehr willkommen!
::: don't try so hard - it'll happen for a reason :::
  Mit Zitat antworten Zitat