-1

On my website, I have a part that reads "Weekdays 10:00 ~ 18:00 /*linebreak/ Saturdays 10:00 ~ 13:30"

And I am trying to get only the numbers to be formatted as "Courier New" font, specifically the "10:00 ~ 18:00" and "10:00 ~ 13:30" parts. And I want set all the rest (the alphabet texts) as "Open Sans" font. How would I get it styled the way I am envisioning using CSS? thank you.

Cih648
  • 1
  • 1
    How do you generate those date? Can you split it to set the hours into a `span`. With a class? – MaxiGui Oct 17 '20 at 07:26

2 Answers2

-1
Weekdays <span id="time">10:00 ~ 18:00</span>
Saturdays <span id="time">10:00 ~ 13:30</span>

.css

#time { font-family : "Courier New" }

Mert Uygur
  • 55
  • 1
  • 5
-1

If you want to set "Open Sans" font for the whole website, set it for the body tag

body { font-family: "Open Sans" } 

Then you override it for any specific element, in your case html:

Weekdays <span class="days-time">10:00 ~ 18:00</span>

css:

.days-time { font-family: "Courier New" }
alihmd
  • 156
  • 1
  • 8
  • Hi, thanks for your feedback! I tried it like this:

    Weekdays 10:00~18:00

    Saturdays 10:00~13:30

    (Sundays are our off-days.)

    but my problem now is that I cannot seem to get the styling for the non-time material to work. I'm not sure what the issue is as is..
    – Cih648 Oct 17 '20 at 10:38
  • Make sure to add the fonts using `@font-face` – alihmd Oct 19 '20 at 06:48