L
L
Leonid2018-10-24 01:11:35
css
Leonid, 2018-10-24 01:11:35

How to make a style change for a repeating div?

Good day! Faced a problem: News site (DLE) For each news, a color is prescribed in the add. field. Default is white (style.css). How can I make the color specified in the additional field change only for this news? That is, it turns out that the CSS properties are the same (there are 3 of them), and the values ​​\u200b\u200bfor each news should be different, on one page ....
It is difficult to explain in words I will try to show.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaliy Pershin, 2018-10-24
@Fouks

In the short news template, add in the right place:

[xfgiven_имяДопПоля]
style="background: [xfvalue_имяДопПоля];
[/xfgiven_имяДопПоля]

In the additional field for each news, respectively, we prescribe, only the value for the background property
It should turn out something like this:
If the field is empty, then nothing will be displayed.
But it would be more correct to set styles through classes, in a similar way.

S
Stalker_RED, 2018-10-24
@Stalker_RED

It?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question