Furt Posted January 25, 2010 Share Posted January 25, 2010 Im using a custom template system i made for my website that im building but css is not showing images in div's when the site is parsed. the only image that is show is the body background-image. style.css body { background-attachment: fixed; background-color: #000; background-image: url(../images/bg.jpg); background-repeat: no-repeat; background-position: center top; } .logo { background-attachment: fixed; background-image: url(../images/logo.jpg); background-repeat: no-repeat; background-position: center top; width:632; height:124; margin-left:auto; margin-right:auto; } im using tpl's if that might be the prob fopen function public function openfiletmp($file) { $handle = fopen($file, "r"); $contents = fread($handle, filesize($file)); fclose($handle); return $contents; } str_replace function public function streplace($txt, $opt, $html) { $streplace = str_replace($opt, $txt, $html); return $streplace; } header.tpl <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>{title}</title> <link rel="shortcut icon" href="includes/images/favicon.ico" /> <link type="text/css" rel="stylesheet" href="templates/basic/css/style.css" /> <script type="text/javascript" src="includes/js/jquery.js"></script> </head> <body> <div class="logo"></div> open tpl's $maintemplate = $tmpl->openfiletmp('templates/'.template.'/theme.tpl'); $headerfile = $tmpl->openfiletmp('templates/'.template.'/theme/header.tpl'); $footerfile = $tmpl->openfiletmp('templates/'.template.'/theme/footer.tpl'); parse $footer = $tmpl->streplace(footerwrite." - Made by Furt <br> Page Created in :".number_format($time, 4, '.', '')."s.",'{copywrite}', $footerfile); $headtitle = $tmpl->streplace(headtitle,'{title}', $headerfile); $headname = $tmpl->streplace(sitename,'{servername}', $headtitle) $parseheader = $tmpl->streplace($headname,'{header}', $maintemplate); $centercontent = $tmpl->streplace(content($_GET['pageid']),'{content}', $parseheader); $parsefooter = $tmpl->streplace($footer,'{footer}', $centercontent); //print page echo $parsefooter; Any ideas on why the body background is showing and the logo div is not? Quote Link to comment https://forums.phpfreaks.com/topic/189711-images-are-not-showing-up-in-divs/ Share on other sites More sharing options...
cags Posted January 25, 2010 Share Posted January 25, 2010 I already spoke to you in the IRC channel, but for completeness sake... You need to add a measurement type to your width and height attributes in your CSS, I believe you want px. Quote Link to comment https://forums.phpfreaks.com/topic/189711-images-are-not-showing-up-in-divs/#findComment-1001247 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.