Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

css in tpl file

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-09-2006, 03:06 PM
 
maximer maximer is offline
 

Member
  
Join Date: Sep 2006
Posts: 22
 

Default 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,
__________________
Version 4.0.18
Reply With Quote
  #2  
Old 11-09-2006, 03:08 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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>
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 11-09-2006, 03:14 PM
 
maximer maximer is offline
 

Member
  
Join Date: Sep 2006
Posts: 22
 

Default 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
__________________
Version 4.0.18
Reply With Quote
  #4  
Old 11-09-2006, 03:18 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 11-09-2006, 03:31 PM
 
maximer maximer is offline
 

Member
  
Join Date: Sep 2006
Posts: 22
 

Default 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
__________________
Version 4.0.18
Reply With Quote
  #6  
Old 11-09-2006, 03:32 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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">
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #7  
Old 11-09-2006, 03:39 PM
 
maximer maximer is offline
 

Member
  
Join Date: Sep 2006
Posts: 22
 

Default 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,
__________________
Version 4.0.18
Reply With Quote
  #8  
Old 11-09-2006, 03:41 PM
 
maximer maximer is offline
 

Member
  
Join Date: Sep 2006
Posts: 22
 

Default 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.
__________________
Version 4.0.18
Reply With Quote
  #9  
Old 11-09-2006, 03:47 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: css in tpl file

Grab yourself a good CSS book, you are gonna need it
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #10  
Old 11-10-2006, 02:49 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default 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
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:09 AM.

   

 
X-Cart forums © 2001-2020