Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 04:20:19 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155555 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: A little advice please  (Read 532 times)
daydreamer

Offline Offline

Posts: 253


« on: March 21, 2008, 10:37:48 AM »

Hi I am working on a new site for a customer.
The home page has a large image but how can I add this image as a background so text can go on top of it.

Don't want to add the image to the index.php as it only wants to be on the home page
Any advice would be great

Thanks
Logged
Bennie_wijs

Offline Offline

Posts: 230



WWW
« Reply #1 on: March 21, 2008, 11:51:26 AM »

You can do is the CSS way or the html way.

What you can do in CSS is:
in index.php:

Change the tag <body> to <body id=<?php echo PAGE_TITLE; ?> >

So if you have a page called "home", you now you can make specific background tag for a specific page:

body #home {
background: #c8d5a9 url('images/background.gif') no-repeat;
}

You need to place this after the normal body { } tag.

Or the HTML way is to make a table with that background
and place the text inside there
Logged

I believe what I want to Believe
daydreamer

Offline Offline

Posts: 253


« Reply #2 on: March 21, 2008, 01:01:38 PM »

Thanks that is superb but can't get it to work this is my index.php code

<?php


if(!defined('WB_URL')) {
    header('Location: ../index.php');
    exit(0);
}

?>
<!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>
<title><?php page_title(); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php if(defined('DEFAULT_CHARSET')) { echo DEFAULT_CHARSET; } else { echo 'utf-8'; }?>" />
<meta name="description" content="<?php page_description(); ?>" />
<meta name="keywords" content="<?php page_keywords(); ?>" />

<?php
if(function_exists('register_frontend_m odfiles')) {
  register_frontend_m odfiles('css');
  register_frontend_m odfiles('js');
} ?>
<link href="/templates/site/style.css" rel="stylesheet" type="text/css" />
</head>
<!--[if IE 6]>
<link href="/templates/site/ie.css" rel="stylesheet" type="text/css" />
<![endif]-->
<body id=<?php echo PAGE_TITLE; ?> >
<div class="header">
  <div class="logo"><a href="/index.php"><img src="/templates/site/images/logo_main.png" width="635" height="170" border="0" /></a></div>
  <div class="topRblock"><?php page_content(3); ?></div>
  <br clear="all" />
</div>




And this is my style sheet:

body {
    font-family : Arial, Helvetica, sans-serif;
    font-size : 14px;
    color : #FFFFFF;
    background-color: #000000;
}    
body   #home {
    background-image: url(/templates/site/images/homeimg.png);
    background-repeat: no-repeat;
    background-color: #000000;
}
.centerall {
    margin-right: auto;
    margin-left: auto;
    width: 995px;
}
.header {
    width: 995px;
    margin-right: auto;
    margin-left: auto;
Logged
marathoner

Offline Offline

Posts: 495


« Reply #3 on: March 22, 2008, 02:23:30 AM »

I didn't look at this too long but did notice a couple of things:

1) that you are defining a style sheet after you </HEAD> tag...all style sheet links should be before the </HEAD> tag.

2) you have closed the anchor tag...twice

3) without knowing the specific background image or how big it is...I notice that you haven't positioned your background image so it's possible that it's simply behind your banner. If this is the case then you need to position your background image.
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!