Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Text with background image on main page

Text with background image on main page

Views: 910

Results 1 to 3 of 3
10 Aug 2011, 7:14 PM
#1
rrzc avatar

rrzc

New Zenner

Join Date:
May 2010
Posts:
52
Plugin Contributions:
0

Text with background image on main page

I'm trying to make a heading with text and background image on the main page like the 'Featured Products' or 'New Products for...' heading. I've been trying to do this using the define pages editor, but haven't been able to get the background image behind the text. Is there a way to do this with html code or does the template file and stylesheet need to be edited?

11 Aug 2011, 8:10 AM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Text with background image on main page

Any zc-assembled page still has to follow HTML rules, so if you do the same, your customisations will work.

As the CONTENT of the define pages can be formatted HTML, all you need do is construct that html properly.

By using proper <div> elements, you can apply your own unique DIV ID or DIV CLASS names. Bear in mind too, that other elements can have ID's and CLASSES (including tables, table rows, table cells, spans, paragraphs... etc.)

So... if you want a DIV (or other element that you create) to have a background image, then do something like this:

<div id="mainPageHeadingBackground"> ... html stuff here... </div>

Then... just add a declaration in your stylesheet:

#mainPageHeadingBackground {
background-image: url(../images/home_page_header_background.jpg);

(The PATH in my declaration will reference the images folder in the template section... but you can reference any path you choose...)

11 Aug 2011, 5:08 PM
#3
rrzc avatar

rrzc

New Zenner

Join Date:
May 2010
Posts:
52
Plugin Contributions:
0

Re: Text with background image on main page

schoolboy, that worked perfectly. Thank you very much!