View Full Version : Divs; Looks great in IE, looks bad in FF.
xxcynthia 12-01-2005, 03:33 AM How sad. =(
I use divs all the time, and my divs always work in both FF and IE. I hate using IE, but my other webmiss loves using IE, so I really want this to be cross-browser.
I don't know what I'm doing wrong, really. You can check the source, and if you /really/ need, I'll put up the script.
http://icon`````.ohlush.org/livejournal/icons.php
&&
http://icon`````.ohlush.org/msn/icons.php
Thanks soo much! <33
Monkey Bizzle 12-01-2005, 06:00 AM From the looks of your code, it looks like you are using PHP includes... Can you post the code for your individual header, content, and footer file for the pages that you linked to? I don't want to correct your coding and then you not know which include to put the corrections into =)
Makar 12-01-2005, 06:06 AM edit: nevermind, delete :P
xxcynthia 12-01-2005, 08:44 PM <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<? include('http://icon`````.ohlush.org/header.php'); ?>
<?php
/*
$catdir = 'categories';
$sort = 'first';
$getcount = true;
$perpage = 15;
$divider = ' ';
// get category folders and sort
if (!file_exists($catdir)) {
echo 'Error! The folder named <strong>'.$catdir.'</strong>, as specified in the config, does not exist. The value of $catdir must match the name of the created folder (case-sensitive), and the folder must exist for the script to work. Create this folder and put the individual icon category folders inside it.';
exit();
}
$getfolders = opendir($catdir);
while (($file = readdir($getfolders)) !== false) {
if (($file != '.' && $file != '..') && (is_dir($catdir.'/'.$file))) {
$cats[] = $file;
}
}
natcasesort($cats);
// build menu
if ((!$_GET['cat']) || (!in_array($_GET['cat'], $cats))) {
?>
<!-- Content Above Menu -->
<h1>MSN Icons</h1>
<!-- End Content Above Menu -->
<?php
echo '<ul id="iconmenu">';
foreach ($cats as $value) {
$catname = str_replace('_', ' ', $value);
if ($getcount) {
$icons = array();
$getcount = opendir($catdir.'/'.$value);
while (($icon = readdir($getcount)) !== false) {
if (eregi(".jpg$|.jpeg$|.gif$|.png$|.bmp$", $icon)) {
$icons[] = $value;
}
}
$count = count($icons);
if ($count == 1) {
echo '<li><a href="'.$_SERVER['PHP_SELF'].'?cat='.$value.'">'.$catname.'</a> ('.$count.' icon)</li>';
} else {
echo '<li><a href="'.$_SERVER['PHP_SELF'].'?cat='.$value.'">'.$catname.'</a> ('.$count.' icons)</li>';
}
} else {
echo '<li><a href="'.$_SERVER['PHP_SELF'].'?cat='.$value.'">'.$catname.'</a></li>';
}
}
echo '</ul>';
}
// show icons
if (in_array($_GET['cat'], $cats)) {
$icons = array();
$geticons = opendir($catdir.'/'.$_GET['cat']);
while (($icon = readdir($geticons)) !== false) {
if (eregi(".jpg$|.jpeg$|.gif$|.png$|.bmp$", $icon)) {
$icons[] = array("name" => $icon, "modified" => filemtime($catdir.'/'.$_GET['cat'].'/'.$icon));
}
}
$count = count($icons);
if ($count > 0) {
function modcmp($a, $b) {
return strcmp($a["modified"], $b["modified"]);
}
usort($icons, 'modcmp');
if ($sort == "first") {
$icons = array_reverse($icons);
}
$catname = str_replace('_', ' ', $_GET['cat']);
if ($count == 1) {
echo '<p><b>'.$catname.': '.$count.' icon</b></p>';
} else {
echo '<p><b>'.$catname.': '.$count.' icons</b></p>';
}
if ($perpage < 1) {
$perpage = 1000;
}
$pagecalc = ($count / $perpage);
$pagecount = ceil($pagecalc);
if (($page > $pagecount) || ($page == "0")) {
$start = 0;
} elseif (!$page) {
$start = 0;
$page = 1;
} elseif (!is_numeric($page)) {
$start = 0;
$page = 1;
} else {
$start = (($page * $perpage) - $perpage);
}
$pagearray = array_slice($icons, $start, $perpage);
//if there is more than one page, show the menu
if ($pagecount > 1) {
if (($page <= $pagecount) && ($page > 1)) {
$backpagecalc = ($page - 1);
$backpage = '<a href="?cat='.$_GET['cat'].'&page='.$backpagecalc.'">«</a> '.$divider;
}
if ($page < $pagecount) {
$nextpagecalc = ($page + 1);
$nextpage = $divider.' <a href="?cat='.$_GET['cat'].'&page='.$nextpagecalc.'">»</a>';
}
echo '<p class="pagemenu">Pages: '.$backpage.' ';
$i = 1;
while ($i <= $pagecount) {
$pagespanstart = ((($i * $perpage) - $perpage) + 1);
$pagespanend = ($i * $perpage);
if ($i == $pagecount) {
if ( $i == $page) {
echo "$i";
} else {
echo "<a href=\"?cat=$_GET[cat]&page=$i\">$i</a>";
}
} else {
if ($i == $page) {
echo "$i $divider ";
} else {
echo "<a href=\"?cat=$_GET[cat]&page=$i\">$i</a> $divider ";
}
}
$i++;
}
echo ' '.$nextpage.'</p>';
}
//show the icons
echo '<p class="icons">';
foreach ($pagearray as $value) {
$iconsize = getimagesize($catdir.'/'.$_GET['cat'].'/'.$value['name']);
echo '<img src="'.$catdir.'/'.$_GET['cat'].'/'.$value['name'].'" '.$iconsize[3].' alt="" /> ';
}
} else {
echo '<p>There are no icons in this category.</p>';
}
echo '</p><p>« <a href="'.$_SERVER['PHP_SELF'].'">back</a></p>';
}
?>
/header.php && /footer.php (header/ footer urls)
xxcynthia 12-01-2005, 08:45 PM Dang. I keep double posting. o-o (this is my double post, but i'm editting it because i can't delete my previous one)
I can't seem to post the full code. =/ Blah.
The header is at icon*woreh*.ohlush.org/header.php, and the footer is at /footer.php =)
Monkey Bizzle 12-01-2005, 09:28 PM <html>
<head>
<title>iCON X ````` - - V. 1 Keira Knightley</title>
<style type="text/css">
A:link
{text-decoration: none;
color: #A862A2;}
A:visited
{text-decoration: none;
color: #A862A2;}
A:active
{text-decoration: none;
color: #A862A2;}
A:hover
{text-decoration: none;
color: #DCD1E1;
background-image: url(http://icon`````.ohlush.org/keirabg.gif);
background-color: #DCD1E1;
cursor: crosshair;}
h1
{font-family: tahoma;
color: #C46AAC;
line-height: 6pt;
font-weight: bold;
font-size: 9pt;
text-align: right;
margin: 0;
margin-top: 1px;
margin-bottom: 1px;
margin-right: 1px;
padding: 1px;
padding-bottom: 0px;
background-color: #FFFFFF;
border-bottom: 1px double #000000;}
h2
{font-family: tahoma;
color: #C46AAC;
line-height: 6pt;
font-weight: bold;
font-size: 9pt;
text-align: right;
margin: 0;
margin-top: 1px;
margin-bottom: 1px;
margin-right: 1px;
padding: 1px;
padding-bottom: 0px;
background-color: #C1B1CB;
border-bottom: 1px double #000000;}
h3
{color: #DCD1E1;
font-family: tahoma;
font-size: 6pt;
line-height: 4pt;
font-weight: none;
margin: 0;
margin-top: 1px;
margin-bottom: 1px;
padding: 0px;
padding-bottom: 0px;
border-bottom: 0px solid #000000;}
p
{font-family: tahoma;
color: #9274A0;}
body
{background: #C1B1CB;
background-image: url(http://icon`````.ohlush.org/keirabg.gif);
font-family: tahoma;
color: #9274A0;
letter-spacing: 0pt;
font-size: x-small;
scrollbar-face-color: #DCD1E1;
scrollbar-highlight-color: #C1B1CB;
scrollbar-3dlight-color: #DCD1E1;
scrollbar-shadow-color: #DCD1E1;
scrollbar-darkshadow-color: #DCD1E1;
scrollbar-track-color: #DCD1E1;
scrollbar-arrow-color: #C1B1CB;}
input, textarea
{background: #FFFFFF;
font-family: tahoma;
font-size: 9px;
color: #C1B1CB;
border-style: solid;
border-color: #C1B1CB;
border-width: 5px;}
</style>
</head>
<body>
<div style="position: absolute; top: 0; left: 1px;">
<img src="http://icon`````.ohlush.org/keirak.gif" width="700" height="700" border="0" usemap="#keiramap_Map">
<map name="keiramap_Map">
<area shape="rect" alt="exits" coords="417,462,607,482" href="/exits.php">
<area shape="rect" alt="icons" coords="417,436,607,456" href="/icons.php">
<area shape="rect" alt="index" coords="417,409,607,429" href="/index.php">
<area shape="rect" alt="contact" coords="417,490,607,510" href="/contact.php">
</map>
</div>
<div style="position: absolute; top: 404px; left: 9px; width: 399px;">
<!-- end header -->
content ONLY goes here
<!-- begin footer -->
<div align="right">
<a href="javascript:history.go(-1)">< < Back ;</a>
</div>
<br>
©2005
<br>
Icon `````.
</div>
</body>
</html>
Monkey Bizzle 12-01-2005, 09:30 PM Okay, copy and paste all of the blue into your header.php and copy and paste all of the red into your footer.php. the only thing that should be in the actual page is the content code... that means NO <html><head> etc. tags. Does that make sense? When you delete the read and the blue from the code that I have provided, you will only have your content left. Replace the red and the blue with the proper include code and there you go.
xxcynthia 12-01-2005, 10:38 PM ONGG IT WORKS!
Thanks soo much.
I was scared that if I take away the meta; whatevers, then I will mess up the code.
Thank you so so so much again. =)
Monkey Bizzle 12-01-2005, 11:21 PM Thanks soo much. I was scared that if I take away the meta; whatevers, then I will mess up the code.
You're welcome, really the main problem was that your code was out of order once you put the includes together.
|