Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New Box Background Color Help


Guest

Recommended Posts

I've made a new box and I'm trying to figer out how to change the background color for that box only. How can I do this?

Link to comment
Share on other sites

nick,

All of the infoboxes are tied to the same style in the stylesheet. I think you'll need to create styles for infobox2 (or whatever) and make reference to that in your new box.

Link to comment
Share on other sites

  • 1 month later...

Try something like this, border will definitely work but not sure about background:

 

In your stylesheet.css file

input the following new

style:

 

.border_specials {

border: solid ridge 3px #dddd15;

                background-color: #000000;

}

 

Now, in includes/boxes/specials.php

where it says:

 

<!-- specials //-->

          <tr>

            <td>

           

change this to:

 

<!-- specials //-->

          <tr>

            <td class="border_specials">

 

From my 'Different Borders For Boxes' contribution.

 

Vger

Link to comment
Share on other sites

Sorry, should have been like this - the style first:

 

DIV.leftnav_blue, .leftnav_blue table {

background-image:url('images/yourimage.gif');

width: 130px;

background-repeat: repeat;

border-left: 0px;

border-right: 0px;

border-bottom: 0px;

border-top: 0px;

}

 

Then in includes/boxes/categories.php

 

<!-- categories //-->

<tr>

<td><center><div class="leftnav_blue">

 

and then at the bottom of that file:

 

new infoBox($info_box_contents);

 

?></center></div>

 

Vger

Link to comment
Share on other sites

I tried it and it works great, only problem is it takes away the border around the box? I took away most of the code and just added what i needed for the bg color.

Link to comment
Share on other sites

To make the border come back...

Sorry, should have been like this - the style first:

 

DIV.leftnav_blue, .leftnav_blue table {

  background-image:url('images/yourimage.gif');

  width: 130px;

  background-repeat: repeat;

  border-left: 0px;

  border-right: 0px;

  border-bottom: 0px;

  border-top: 0px;

}

Change this

  border-left: 0px;
 border-right: 0px;
 border-bottom: 0px;
 border-top: 0px;

To this

  border-left: 1px;
 border-right: 1px;
 border-bottom: 1px;
 border-top: 1px;

Border should come back.

Link to comment
Share on other sites

How about:

DIV.leftnav_blue, .leftnav_blue table {
 background-image:url('images/yourimage.gif');
 width: 130px;
 background-repeat: repeat;
 border-color: #000000;
 border-style: solid;
 border-width: 1px;

Link to comment
Share on other sites

OK, back to your original question.

 

I've made a new box and I'm trying to figer out how to change the background color for that box only. How can I do this?

 

I originally thought you wanted a background image not just changing the background color. Guess I should have read the whole post. :P

There is a whole article in the knowledge base about creating new box classes. It's here...

http://www.oscommerce.info/kb/osCommerce/C..._Area/Boxes/248

Once you accomplish this feat, you can then apply attributes to that new class in your stylesheet.

More info here about css.

 

Good Luck. Hopefully you get on the right track. :D

Link to comment
Share on other sites

That's awesome thanks for that. There is only one box I can't seem to change with a class, that being the box on the index page which is used by new_products and stored in modules. How do I set that box a class?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...