Avatar billede krea Praktikant
28. januar 2007 - 12:26 Der er 9 kommentarer og
1 løsning

Vil ikke centrere i firefox

Min adsense er ikke centreret i firefox - kun i IE. Hvad gør jeg så den også er centreret i firefox ?

<base target="_self">
<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">

<div align="center">


<script type="text/javascript"><!--
google_ad_client = "";
google_alternate_ad_url = "";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="2110003788";
google_color_border = "FBFCEE";
google_color_bg = "FBFCEE";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
Avatar billede apo Praktikant
28. januar 2007 - 12:57 #1
Ud fra din kode at dømme, skriver du mangelfuld HTML. Hvis den kode du har vist herover er den du har i dine dokumenter, så kan jeg godt forstå at du har dine problemer.

Efter <table> skal du have en <tr> og en <td>... Table-syntaxen bør se således ud:

<table>
  <tr>
      <td></td>
  </tr>
</table>

... hvor du, efter <table> går direkte over til at bruge et <div> (forkert).
Avatar billede krea Praktikant
28. januar 2007 - 13:08 #2
OK - den fulde table kode: (med et par overstregninger af titler og links)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="ltr">
<head>
<META NAME="keywords" CONTENT= "">
<META NAME="description" CONTENT="">
<META HTTP-EQUIV="Content-Language" CONTENT="DA">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<META NAME="Title" CONTENT="">


<link rel="top" href="http://www./" title="" />
<link rel="search" href="./search.php" title="Søg" />
<link rel="help" href="./faq.php" title="FAQ" />
<link rel="author" href="./memberlist.php" title="Tilmeldte brugere" />
<title></title>
<!-- link rel="stylesheet" href="templates/subSilver/subSilver.css" type="text/css" -->
<style type="text/css">
<!--
/*
  The original subSilver Theme for phpBB version 2+
  Created by subBlue design
  http://www.subBlue.com

  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;
    scrollbar-face-color: #DEE3E7;
    scrollbar-highlight-color: #FFFFFF;
    scrollbar-shadow-color: #DEE3E7;
    scrollbar-3dlight-color: #D1D7DC;
    scrollbar-arrow-color:  #006699;
    scrollbar-track-color: #EFEFEF;
    scrollbar-darkshadow-color: #98AAB1;
}

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

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

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

/* Main table cell colours and backgrounds */
td.row1    { background-color: #EFEFEF; }
td.row2    { background-color: #DEE3E7; }
td.row3    { background-color: #D1D7DC; }

/*
  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: #FFFFFF;
        background-image: url(templates/subSilver/images/cellpic2.jpg);
        background-repeat: repeat-y;
}

/* Header cells - the blue and silver gradient backgrounds */
th    {
    color: #FFA34F; font-size: 11px; font-weight : bold;
    background-color: #006699; height: 25px;
    background-image: url(templates/subSilver/images/cellpic3.gif);
}

td.cat,td.catHead,td.catSides,td.catLeft,td.catRight,td.catBottom {
            background-image: url(templates/subSilver/images/cellpic1.gif);
            background-color:#D1D7DC; border: #FFFFFF; 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: #FFFFFF; border-style: solid; height: 28px;
}
td.row3Right,td.spaceRow {
    background-color: #D1D7DC; border: #FFFFFF; border-style: solid;
}

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

/* The largest text used in the index page title and toptic title etc. */
.maintitle    {
    font-weight: bold; font-size: 22px; font-family: "Trebuchet MS",Verdana, Arial, Helvetica, sans-serif;
    text-decoration: none; line-height : 120%; color : #000000;
}

/* General text */
.gen { font-size : 12px; }
.genmed { font-size : 11px; }
.gensmall { font-size : 10px; }
.gen,.genmed,.gensmall { color : #000000; }
a.gen,a.genmed,a.gensmall { color: #006699; text-decoration: none; }
a.gen:hover,a.genmed:hover,a.gensmall:hover    { color: #DD6900; text-decoration: underline; }

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

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

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

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

/* titles for the topics: could specify viewed link colour too */
.topictitle,h1,h2    { font-weight: bold; font-size: 11px; color : #000000; }
a.topictitle:link  { text-decoration: none; color : #006699; }
a.topictitle:visited { text-decoration: none; color : #5493B4; }
a.topictitle:hover    { text-decoration: underline; color : #DD6900; }

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

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

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

/* Quote & Code blocks */
.code {
    font-family: Courier, 'Courier New', sans-serif; font-size: 11px; color: #006600;
    background-color: #FAFAFA; border: #D1D7DC; border-style: solid;
    border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px
}

.quote {
    font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #444444; line-height: 125%;
    background-color: #FAFAFA; border: #D1D7DC; 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: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;}
a.copyright        { color: #444444; text-decoration: none;}
a.copyright:hover { color: #000000; text-decoration: underline;}

/* Form elements */
input,textarea, select {
    color : #000000;
    font: normal 11px Verdana, Arial, Helvetica, sans-serif;
    border-color : #000000;
}

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

input { text-indent : 2px; }

/* The buttons used for bbCode styling in message post */
input.button {
    background-color : #EFEFEF;
    color : #000000;
    font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif;
}

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

/* None-bold submit button */
input.liteoption {
    background-color : #FAFAFA;
    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: #DEE3E7; border-style: none; }
td.inlineadtitle {
    background-color: #D1D7DC; border: #FFFFFF; border-style: solid; border-width: 1px;
}
td.inlinead {
    background-color: #D1D7DC; border: #FFFFFF; border-style: solid; border-width: 1px; text-align: center;
}

/* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */
@import url("templates/subSilver/formIE.css");

/* Begin Simple Subforums MOD */
a.topic-new, a.topic-new:visited { color: #DD6900; }
a.topic-new:hover, a.topic-new:active { color: #006699; }
/* End Simple Subforums MOD */


-->
</style>
</head>
<body bgcolor="#E5E5E5" text="#000000" link="#006699" vlink="#5493B4">

<a name="top"></a>

<table width="100%" cellspacing="0" cellpadding="10" border="0" align="center">
    <tr>
        <td class="bodyline"><table width="100%" cellspacing="0" cellpadding="0" border="0">
            <tr>
                <td><a href="http://www.mysite.dk/"><img src="templates/subSilver/images/logo_phpBB.gif" border="0" alt="Indeks" vspace="1" /></a></td>
                <td align="center" width="100%" valign="middle"><span class="maintitle"></span><br /><span class="gen">"<br />&nbsp; </span>
                <table cellspacing="0" cellpadding="2" border="0">
                    <tr>
                        <td align="center" valign="top" nowrap="nowrap"><span class="mainmenu">&nbsp;<a href="faq.php" class="mainmenu"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="FAQ" hspace="3" />FAQ</a>&nbsp; &nbsp;<a href="search.php" class="mainmenu"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="Søg" hspace="3" />Søg</a>&nbsp; &nbsp;<a href="memberlist.php" class="mainmenu"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="Tilmeldte brugere" hspace="3" />Tilmeldte brugere</a>&nbsp; &nbsp;<a href="groupcp.php" class="mainmenu"><img src="templates/subSilver/images/icon_mini_groups.gif" width="12" height="13" border="0" alt="Grupper" hspace="3" />Grupper</a>&nbsp;
                                                &nbsp;<a href="profile.php?mode=register" class="mainmenu"><img src="templates/subSilver/images/icon_mini_register.gif" width="12" height="13" border="0" alt="Tilmeld" hspace="3" />Tilmeld</a>&nbsp;
                       

                        </span></td>
                    </tr>
                    <tr>
                        <td height="25" align="center" valign="top" nowrap="nowrap"><span class="mainmenu">&nbsp;<a href="profile.php?mode=editprofile" class="mainmenu"><img src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="Profil" hspace="3" />Profil</a>&nbsp; &nbsp;<a href="privmsg.php?folder=inbox" class="mainmenu"><img src="templates/subSilver/images/icon_mini_message.gif" width="12" height="13" border="0" alt="Login for at vise private beskeder" hspace="3" />Login for at vise private beskeder</a>&nbsp; &nbsp;<a href="login.php" class="mainmenu"><img src="templates/subSilver/images/icon_mini_login.gif" width="12" height="13" border="0" alt="Login" hspace="3" />Login</a>&nbsp;<a href="http://www.thegame-online.dk/links.htm">Links
</a></span></td>
                    </tr>
                </table></td>
            </tr>
        </table>

        <br />


<!-- google_ad_section_start(weight=ignore) -->
<base target="_self">
<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">

<div align="center">



<p> </p>
<script type="text/javascript"><!--
google_ad_client = "";
google_alternate_ad_url = "";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="2110003788";
google_color_border = "FBFCEE";
google_color_bg = "FBFCEE";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>

 

  <tr>

    <td align="left" valign="bottom"><span class="gensmall">
        Lige nu er det <b>Søn 28 jan 13:02</b><br /></span><span class="nav"><a href="http://www./" class="nav">Indeks</a></span></td>
    <td align="right" valign="bottom" class="gensmall">
                <a href="search.php?search_id=unanswered" class="gensmall">Vis ubesvarede indlæg</a></td>
  </tr>
</table>
Avatar billede apo Praktikant
28. januar 2007 - 13:20 #3
Prøv at læse mit indlæg 28/01-2007 12:57:37 - den nederste linje (der står noget du kan bruge til fejlfinding).

I øvrigt så bør du gennemgå dine dokumenter via validator.w3.org - især hvis du ikke er så stærk i HTML.
Avatar billede krea Praktikant
28. januar 2007 - 13:27 #4
Hvis jeg fjerner det pågældende div forsvinder centreringen fra IE også - det forværrer bare situationen.
Avatar billede apo Praktikant
28. januar 2007 - 13:50 #5
Så er du ikke med på hvad jeg hentyder til i indlægget 28/01-2007 12:57:37.

Min pointe er den, at du ikke benytter de nødvendige HTML-elementer (du undladder at bruge alle elementerne, som de skal bruges).

Hvis du undlader visse elementer, er det klart at du har problemer med at få din kode til at virke.

Din kode ser således ud (et uddrag):

<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">

<div align="center">

Hvor det vil være korrekt brug af HTML, at skrive:

<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
  <tr>
      <td align="center">
        <div align="center">

Prøv også at køre din nuværende kode gennem W3's validator - http://validator.w3.org - jeg kan se at du vil blive gjort opmærksom på flere fejl.
Avatar billede apo Praktikant
28. januar 2007 - 13:54 #6
Du kan ikke bare gå direkte fra <table> over til at indsætte et <div> - du er nødt til at følge table-syntaxen:

KORREKT:

1: <table>
2: <tr>
3: <td>
4: </td>
5: </tr>
6: </table>

i stedet for at ændre den til:

FORKERT:

1: <table>
2: <div>

Er du med på hvad jeg mener?
Avatar billede krea Praktikant
28. januar 2007 - 14:06 #7
Jeg har slettet div og ført adsense ud af table og op i toppen og brugt <p align="center">

nu virker det.

smid venligst svar.
Avatar billede apo Praktikant
28. januar 2007 - 14:09 #8
Ok, men forstod du meningen med det jeg viste i mit sidste indlæg?

Det er vigtigt, at du benytter HTML-elementerne som de er tiltænkt - hvis man laver sine egne 'løsninger', kan browserne ikke forstå hvad man vil.
Avatar billede krea Praktikant
28. januar 2007 - 14:12 #9
Ja
Avatar billede apo Praktikant
28. januar 2007 - 14:14 #10
Godt. Tak for points.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester



IT-JOB

Cognizant Technology Solutions Denmark ApS

Service Line Specialist – EPS – SAP

Politiets Efterretningstjeneste

DevOps Softwareudviklere