webForumDet fria alternativet

Problem med php include

2 svar · 989 visningar · startad av luan

luanMedlem sedan apr. 2003116 inlägg
#1

Hej,
Jobbar med en hemsida åt min pappas bolag och försökt att lägga in en Sharethis-knappsats men får hela tiden problemet att botten förlängs otroligt mycket.

Såhär ser det ut med Shareknappsatsen: http://www.harvestbaker.se/intersearch_beta/chefsrekrytering.php

Såhär ser sidan ut utan shareknappsatsen:
http://www.harvestbaker.se/intersearch_beta/vdrekrytering.php

Sidorna är kodmässigt exakta bortsett från att chefsrekrytering.php innehåller följande: <?php include("share.php"); ?>

Koden i share.php ser ut såhär:

Rekommendera denna sida till kollegor/vänner:<bR><br> 

<!-- AddThis Button BEGIN --> 
<div class="addthis_toolbox addthis_default_style "> 
<a class="addthis_button_preferred_1"></a> 
<a class="addthis_button_preferred_2"></a> 
<a class="addthis_button_preferred_3"></a> 
<a class="addthis_button_preferred_4"></a> 
<a class="addthis_button_compact"></a> 
<a class="addthis_counter addthis_bubble_style"></a> 
</div> 
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4dd66db5070d4a7f"></script> 
<!-- AddThis Button END -->

Koden i chefsrekrytering.php ser ut såhär:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<!-- our company--> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!-- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />--> 
<meta name="description" content="Chefsrekrytering - rekrytering av chefer till lokala och internationella chefspositioner"> 
<meta name="keywords" content="chefsrekrytering, rekrytera chef, chef rekrytering, rekrytering chef, rekrytering chefer, rekrytering av chefer, rekrytering av chef"> 

<title>Chefsrekrytering - rekrytering av chefer</title> 

<link href="css1.css" rel="stylesheet" type="text/css" media="screen" /> 

</head> 

<body> 

<div id="wrapper"> 

<?php include("tjanstmenu.php"); ?> 

<div id="content_short"> 

<div id="box_under_ourcompany"> <h1>Chefsrekrytering</h1> 
<p>Text om chefsrekrytering.</p> 
</p></div> 
<div id="box_under_ourcompany_right"><p> 
<img src="images/chefsrekrytering.gif" alt="Chefsrekrytering - rekrytering av chefer till lokala och internationella chefspositioner" border="0" width="370" height="242"><br><i>Intersearch konsulter har alla erfarenhet av chefspositioner och vet därför också vad som krävs av en ny chef. Detta underlättar vår chefsrekrytering och höjer kvalitén.</i><br><?php include("share.php"); ?> 
</p> 
</p></div> 

</div> 

<?php include("footer.php"); ?> 

<div style="clear: both;"> </div> 

</div> <!-- end #wrapper --> 
<?php include("google.php"); ?> 
</body> 
</html>

CSS-filen ser ut såhär:

/* längst bak */ 
body { 
margin-top: 10px; 
background: #292929;/*#e6e6e6; /* grey*/ 
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; 
font-size: 13px; 
color: #4a525a; 
} 

/* Mitten-rutan */ 
#wrapper { 
width: 960px; /*1010*/ 
/*height:400px; */ 
margin: 0 auto; 
padding: 10px 0 10px 0; /*top right bottom left*/ 
background: white; 
/*border-left: 1px solid #b5b5b5;*/ 
border: 1px solid black; 
} 
#wrapper h1, h2, h3 { 
margin: 0; 
font-family: Bell Gothic Std Light, Georgia, "Times New Roman", Times, serif; 
font-weight: normal; 
color:#3e3e3e; 

} 

/* Header */ 

#header { 
width: 960px; /*1010*/ 
height:200px; 
/*margin: 0 auto;*/ 
margin-top:10px; 
padding-bottom: 5px; 
background: white; 
border-bottom: 1px solid #8B814C; /*#CC0C00*/ 
/*background: #FFFFFF url(searchingforstars.gif) center center no-repeat; */ 

} 

/*logo i header */ 
#logo{ 

position: relative; left: 0px; bottom: 0px; 
margin-top:0px; 
width: 940px; /*1010*/ 
height:155px; 
background: white; 
padding: 0 0 0 0; 

/*border: 1px; */ 
/*background: #FFFFFF url(underlogga.jpg) center center no-repeat; */ 
} 

#logo2{ 

position: relative; left: 695px; bottom: 20px; 
margin-top:0px; 
width:220px; 
height: 40px; 
background: white; 
padding: 0 0 0 0; 
/*border: 1px; */ 
/*background: #FFFFFF url(underlogga.jpg) center center no-repeat; */ 
} 

#language{ 

position: relative; left: 770px; bottom: 10px; 
margin-top:0px; 
width:30px; 
height: 7px; 
background: white; 
padding: 0 0 0 0; 
font-size: 11px; 
font-weight:bold; 
/*border: 1px; */ 
/*background: #FFFFFF url(underlogga.jpg) center center no-repeat; */ 
} 
#languageflag{ 

margin-top:0px; 
width:30px; 
height: 40px; 
background: white; 
padding: 0 0 0 0; 
font-size: 11px; 
font-weight:bold; 
/*border: 1px; */ 
/*background: #FFFFFF url(underlogga.jpg) center center no-repeat; */ 
} 
#language a{ 

} 
#textinheader{ 

margin-top:0px; 
width:680px; 
height: 20px; 
/*background: white;*/ 
padding: 0 0 0 43px;/*top right bottom left*/ 
/*border: 1px; */ 
/*background: #FFFFFF url(underlogga.jpg) center center no-repeat; */ 
} 
#boxleft{ 

margin-left: 10px; 
width:240px; 
height: 340px; 
background:white; 
padding: 0px 20px 20px 8px; /*top right bottom left*/ 

} 
#boxmiddle{ 
position:relative; left: 300px; bottom: 360px; 
width:240px; 
height: 350px; 
background:white; 
padding: 0px 20px 20px 30px; /*top right bottom left*/ 
border-left: 1px solid #b5b5b5; 
} 
#boxright{ 
position:relative; left: 585px; bottom: 730px; 
width:240px; 
height: 350px; 
background:white; 
padding: 0px 20px 20px 30px; /*top right bottom left*/ 
border-left: 1px solid #b5b5b5; 
} 
#box_under_ourcompany{ 
margin-left: 18px; 
width:350px; 
height: 300px; 
background:white; 
padding: 0px 10px 0px 0px; /*top right bottom left*/ 

} 
#box_under_ourcompany_right{ 
position:relative; left: 430px; bottom: 270px; 
margin-left: 10px; 
margin-right: 15px; 
width:380px; 
height: 300px; 
background:white; 
padding: 0px 20px 20px 30px; /*top right bottom left*/ 

} 

#box_under_conf{ 
margin-left: 10px; 
width:380px; 
height: 300px; 
background:white; 
padding: 0px 20px 20px 30px; /*top right bottom left*/ 
border-left: 1px solid #b5b5b5; 
} 
#box_under_left{ 
margin-left: 10px; 
width:380px; 
height: 560px; 
background:white; 
padding: 0px 20px 20px 30px; /*top right bottom left*/ 
border-left: 1px solid #b5b5b5; 
} 
#box_under_right{ 
position:relative; left: 450px; bottom: 580px; 
width:380px; 
height: 560px; 
background:white; 
padding: 0px 20px 20px 30px; /*top right bottom left*/ 
border-left: 1px solid #b5b5b5; 
} 

#consultant_image{ 
position:relative; left:0px; bottom: 0px; 
width:150px; 
height: 225px; 
background:white; 

} 
#consultant_image_big{ 
position:relative; left:0px; bottom: 0px; 
width:200px; 
height: 300px; 
background:white; 

} 
#consultant_text{ 
position:relative; left: 150px; bottom: 225px; 
margin-left:15px; 
width:580px; 
height: 210px; 
background:white; 
padding: 10px 0px 0px 20px; /*top right bottom left*/ 

} 
#consultant_text_long{ 
position:relative; left: 200px; bottom: 300px; 
margin-left:15px; 
width:580px; 
height:auto; 
background:white; 
padding: 10px 0px 0px 20px; /*top right bottom left*/ 

} 
#whole_wrapper_consultants{ 
margin-left: 10px; 
width:600px; 
height: auto; 
background:white; 
padding: 0px 20px 20px 30px; /*top right bottom left*/ 
border-left: 1px solid #b5b5b5; 
} 
#consultant_wrapper{ 
margin-left:10px; 
margin-top:15px; 
width:750px; 
height: 225px; 
background:white; 
padding: 20px 0px 0px 0px; /*top right bottom left*/ 
border-bottom: 2px solid #b5b5b5; 

} 

} 
#consultant_wrapper_long{ 
margin-left:10px; 
margin-top:15px; 
width:750px; 
height: auto; 
background:white; 
padding: 0px 0px 0px 0px; /*top right bottom left*/ 

border-top: 1px solid #b5b5b5; 

} 

/* Page 
#page { 
width: 940px; 
margin: 0 auto; 
} 
*/ 
table.sample { 
table-layout: fixed; 
width: 350px; 
border-width: 1px 1px 1px 1px; 
border-spacing: 0px; 
/*border-style: outset outset outset outset;*/ 
border-color: gray gray gray gray; 
border-collapse: separate; 
background-color: white; 
} 
table.sample td { 
padding: 5px;/*Pads each table cell in modern browsers*/ 
} 

/* Content, innehåll i mittenrutan */ 

#content { 
/*float: right;*/ 
width: 600px; 
height: 500px; 
padding: 35px 10px 0 0; 
margin-left: 25px; 
margin-top:20px; 
/*height: 400px;*/ 
} 

#content_short { 
/*float: right;*/ 
width: 600px; 
height: 400px; 
padding: 0px 10px 0px 0; 
margin-left: 25px; 
margin-top:20px; 
/*height: 400px;*/ 

} 
#content_assignment{ 
/*float: right;*/ 
width: 600px; 
height: 750px; 
padding: 35px 10px 0 0; 
margin-left: 25px; 
margin-top:20px; 
/*height: 400px;*/ 

} 
#content_services { 
/*float: right;*/ 
width: 600px; 
height: 500px; 
padding: 35px 10px 0 0; 
margin-left: 25px; 
margin-top:20px; 
/*height: 400px;*/ 

} 
#content_consultants { 
/*float: right;*/ 
width: 600px; 
height: auto; 
padding: 35px 10px 0 0; 
margin-left: 25px; 
margin-top:20px; 
/*height: 400px;*/ 

} 
#content_long { 
/*float: right;*/ 
width: 600px; 
height: 940px; 
padding: 35px 10px 0 0; 
margin-left: 25px; 
margin-top:20px; 
/*height: 400px;*/ 
} 
/* Footer */ 
#footer { 
width: 925px; 
height: 18px; 
margin: 0 auto; 
padding: 10px 0px 0px 35px; /*top right bottom left*/ 
/*background: #e6e6e6; */ 
font-family: Arial, Helvetica, sans-serif; 
color: #8B814C; 
border-top: 1px solid #8B814C; 
} 

#footer p { 
margin: 0; 
line-height: normal; 
font-size: 9px; 
text-transform: none; 
text-align: left; 
margin-left:30px; 
} 

#footer a { 
color: #8B814C; 
} 
#footer a :hover{ 
color: black; 
} 

.menuTwo { 
width: 892px; 
height: 15px; 
margin: 0 auto; 
padding: 4px; 
/*border-bottom: 1px solid #CC0C00;*/ 
background: white; 
/*border-bottom: 1px solid #CC0C00;*/ 
/*background: #6b6b6b;*/ 
} 

.menuTwo ul { 

list-style: none; 
line-height: normal; 
margin-left: 0px; 
padding: 3px; 
} 

.menuTwo li 
{ 

display: inline; /* skriver ut listan på rad*/ 
list-style-type: none; /* tar bort punkterna i listan*/ 

} 

.menuTwo li a{ 
text-decoration: none; /* ingen understrykning*/ 
color: #292929; 
padding: 5px 10px 0 5px; /*top right bottom left*/ 
text-decoration: none; 
/*border-right: 1px solid grey;*/ 
list-style-type: none; /* tar bort punkterna i listan*/ 
font-family: Arial, Helvetica, sans-serif; 
font-size: 11px; 
font-weight: bold; 

} 

.menuTwo a { 

border: none; 
} 

.menuTwo li a:hover, .menuTwo li.selected a{ 
/*background: grey; */ 
text-decoration: none; /* ingen understrykning*/ 

list-style-type: none; /* tar bort punkterna i listan*/ 
font-family: Arial, Helvetica, sans-serif; 
color: #8B814C; 

} 

#content a:hover{ 
color: #8B814C; 
} 

/* TEXTDEKORATION */ 
blockquote 
{ 
margin-top: 0; 
line-height: 180%; 
font-size:0.97em; 
/*padding-right: 45px;*/ 
} 

h1 { 

font-weight:bold; 
font-size: 1.3em; 
padding:10px 0px 35px 0px; 
} 

h2 { 
font-size: 1.6em; 
padding: 10px 0px 30px 0px; 
} 

h3 { 
font-size: 1.4em; 
padding: 10px 10px 25px 0px; /*top right bottom left*/ 
} 
h4 { 

color: #4A525A;/*#00004F;*/ 
font-weight:bold; 
font-size:1.0em; 
line-height: 180%; 
} 

h5{ 
color: #8B814C; 
margin-top: 0; 
line-height: 180%; 
font-size:0.90em; 
} 
h6 { 
font-size: 1.4em; 
padding: 10px 10px 25px 10px; /*top right bottom left*/ 
} 

p, ul, ol { 
margin-top: 0; 
line-height: 180%; 
font-size:0.97em; 
/*padding-right: 45px;*/ 

} 

ul, ol { 
} 

a { 
text-decoration: none; 
border-bottom: none; 
color: #0A0A0A; 
} 

a:hover { 
background: none; 
}

Hoppas någon kan hjälpa mig lösa detta.

Tack på förhand!

newseedMedlem sedan maj 2010118 inlägg
#2

Problemet ligger i följande kod:

<div style="clear: both;"> </div>

6:e raden från slutet i huvud PHP-filen.

Den koden får clear-kommandot att ta hänsyn till den för närvarande dolda informationen från addthis. Tar du bort "clear:both" ser det bättre ut. Frågan är dock om du behöver denna kod på någon annan sida?

@ndersMedlem sedan juni 200026 914 inlägg
#3

... och: använd inte

-taggarna, koden blir mycket mer lättläst med [php] eller [kod], som är anpassade för att visa kod.

mvh

Genererad på 384 ms · cache AV · v20260730165559-full.f96bc7eb