1

I have this dictionary value, something like this:

@Umbraco.GetDictionaryValue("BookingStep1_ClosedPickup")

in it I have a sentence that says something like:

The location Closing hour is 16 and in the dict value i have defigned hours like so [hours] so it shows the user "16".

the question is how to style just that part of the dict value? I want it to be red, bold or whatever. I cant seem to find any way to target it.

user1780729
  • 520
  • 1
  • 7
  • 24

1 Answers1

1

You can wrap the call to get the dictionary item in an HTML element and target it with CSS to apply styling:

Razor script:

<p>The location Closing hour is 16 and in the dict value i have defigned hours like so <strong class="red">@Umbraco.GetDictionaryValue("BookingStep1_ClosedPickup")</strong> so it shows the user "16".</p>

CSS:

strong {
  font-weight: bold;
}

strong.red {
  font-color: #ff0000;
}

To target part of the dictionary item text you could include the HTML element in your dictionary item definition. In this case the dictionary item would be something like:

The location Closing hour is <strong class="red">[hours]</strong>
co0ke
  • 36
  • 3