XF 2.2 data-field and css?

Robert9

Well-known member
The custom_fields have "data-field=field_name".
Can i use this for css?

Or should i wrap something around like <div class="fieldname">...</div>
with .fieldname ol li { ... }
 
Yes.

I have posted many examples of using them.

Yes, any of the HTML 5 attributes can be used, for example:
Less:
[data-logged-in="false"]

[data-logged-in="true"]

[data-template*="name"]

[data-template="template_name"]

[data-type="type"]

[data-container-key="node-ID"]

[data-content-key="thread-ID"]


They can be further refined by joining attributes without a comma:
Less:
[data-template="template_name"][data-type="type"]


Or made to apply to multiple attributes with a comma:
Less:
[data-container-key="node-ID"],
[data-content-key="thread-ID"],
[data-type="type"]
 
And how can you apply the same CSS to several data-field?

I have tried with comas and without it, but it doesn't work:


[data-field="A"], [data-field="B"]
[data-field="A"][data-field="B"]
 
Back
Top Bottom