X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   css in tpl file (https://forum.x-cart.com/showthread.php?t=26498)

maximer 11-09-2006 03:06 PM

css in tpl file
 
Hi,

I have tried without succes, to appent/use/insert css style in welcome.tpl

1 method by:
<link rel="stylesheet" type="text/css" href="prom_tab.css" media="screen"/>
don't work.

2 method by <style>
#prom_tab { margin: 0px auto 0px auto;
padding: 0px 0px 0px 0px;
width: 515px;
font-size: 11px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
#prom_tab table { width: 510px;
text-align: center;
border: 1px solid #000;
}...........
</style>
displays error at prom_tab { margin: 0px.....

So, how to use custom style in tpl file ?

regards,

balinor 11-09-2006 03:08 PM

Re: css in tpl file
 
You can't do either as there is no <head> tag in welcome.tpl. Use the main stylesheet and use a <div> to call the style:

<div class="newstyle">
content
</div>

maximer 11-09-2006 03:14 PM

Re: css in tpl file
 
Quote:

Originally Posted by balinor
You can't do either as there is no <head> tag in welcome.tpl. Use the main stylesheet and use a <div> to call the style:

<div class="newstyle">
content
</div>



I have tried with <head> with no succes.
I use div, please look:
<div id="prom_tab">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="header" colspan="6">Optimized Price Performance</td>........................
...............
</div>

If I use <style> .... which format use: ?
1 #prom_tab {...............
2 .prom_tab {........
3 <style> <!-- .................. --> </style>

regards

balinor 11-09-2006 03:18 PM

Re: css in tpl file
 
No, you aren't understanding. You can't call a stylesheet in a template, nor can you put a <head> tag in a template. There is one central stylesheet in X-Cart, you put all of your styles there, skin1.css. You then call those styles via a <div> like I showed you.

maximer 11-09-2006 03:31 PM

Re: css in tpl file
 
Quote:

Originally Posted by balinor
No, you aren't understanding. You can't call a stylesheet in a template, nor can you put a <head> tag in a template. There is one central stylesheet in X-Cart, you put all of your styles there, skin1.css. You then call those styles via a <div> like I showed you.


OK. I do you sugested - added my styles to skin1_sustomer.css

here some of code of skin1_sustomer.css:
.prom_tab { margin: 0px auto 0px auto;
padding: 0px 0px 0px 0px;
width: 515px;
font-size: 11px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
.prom_tab table { width: 510px;
text-align: center;
border: 1px solid #000;
}
.prom_tab td.top { text-align: left;
padding: 3px 0px 3px 5px;
background-color: #09387E;
color: #FFF;
font-size: 12px;
}

..................

and here some of my welcome.tpl file :

<div id="prom_tab">
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="6" class="top">Models with</td>
</tr>
<tr>
<td class="header" colspan="6">Optimized Price Performance</td>
</tr>
.........
I have cleaned my templates_c directory and it don't work.

regards

balinor 11-09-2006 03:32 PM

Re: css in tpl file
 
Well if you are using a table you need to add it to the table instead of a <div>

<table cellpadding="0" cellspacing="0" class="prom_tab">

maximer 11-09-2006 03:39 PM

Re: css in tpl file
 
Quote:

Originally Posted by balinor
Well if you are using a table you need to add it to the table instead of a <div>

<table cellpadding="0" cellspacing="0" class="prom_tab">



Here end of my welcome.tpl file:

</table>
</div>

Any ideas ?


regards,

maximer 11-09-2006 03:41 PM

Re: css in tpl file
 
Quote:

Originally Posted by maximer
Here end of my welcome.tpl file:

</table>
</div>

Any ideas ?


regards,


Sorry for misunderstunding. It works.

Thanks a lot - You are guru.

balinor 11-09-2006 03:47 PM

Re: css in tpl file
 
Grab yourself a good CSS book, you are gonna need it :)

carpeperdiem 11-10-2006 02:49 AM

Re: css in tpl file
 
Padraic,

Is it a BAD THING to have more than one style sheet?

For example, certain 3rd party mods have their own style sheet - is there any reason why 2 or 3 can't live together? It works fine, but is it a bad thing? Is there a performance hit or is there something that may bite me later? Should I simply consolidate all 3 files into one mega CSS file?

Thanks,

Jeremy


All times are GMT -8. The time now is 02:47 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.