Guest
26 Jun 2013 12:04

I am using a full article custom template created by copying 8.40 template version

I checked and it correctly contains field->fieldclass (not field->class)

to customize it I deleted the part generating the fields and subsituted it with custom fields (fields_by_id)

**but I left there the part generating the tabs/groups **

now inside these field groups I want to add style to the labels and fields

I added the classes name in the fields settings, and obviously I created the classes in my template custom css file

but the styles are not being applied

I attach the record template and my custom css file if you want to check

Hidden text

Last Modified: 02 Mar 2014


Sergey
Total posts: 13,748
27 Jun 2013 05:17

Why?

I do see that class is there

And fact that CSS rules are not apply the only reasons

  1. CSS file is not included on the page

  2. CSS rules overridden by other CSS file that is loaded later.


Guest
27 Jun 2013 05:20

mhhh... I understand

I added that css class to my custom css file of my site template

is this wrong in general?

should I insert in custom record template css file, or main cobalt custom.css file instead?


Guest
27 Jun 2013 05:25

ok, solved

I just needed to add article before class in css file, to better specify the rule

article .cb-title-1 {font-weight:bold;

font-size:120%;

}


Sergey
Total posts: 13,748
27 Jun 2013 05:29

should I insert in custom record template css file, or main cobalt custom.css file instead?

yes you can insert there or tight in template create block. Or create CSS fiel with the same name as php template file in the same folder. But if your style 20-50 lines just place it in in your template.


Sergey
Total posts: 13,748
27 Jun 2013 05:31

I just needed to add article before class in css file, to better specify the rule

Yes, CSS selector Specificity matters.


Guest
27 Jun 2013 05:34

tight in template create blocktight in template create block

I thought this was not a good behaviour in general because it would affect the site performance... so I always tried to avoid it, but to be honest I don't know why I have this opinion, i must have read it somewhere in the past... do you deny it? :)


Sergey
Total posts: 13,748
27 Jun 2013 05:41

the main problem of this approach is that it is always loaded. i mean if you have it in CSS file it is loaded once and then cached by browser. block is loaded on every page refresh.

But as I had mentioned if you have 20-50 lines it will not make a difference. Especial the fact that page is gzipped you will add 5-10 bytes which is nothing.

I onten use this method when I have small block and use CSS file only if CSS is really big.

Powered by Cobalt