0

I am using @font-face to use custom fonts like this

 @font-face {
  font-family: 'Simpletext';
  src: url('MYRIADPRO-REGULAR.woff') format('woff'); 
}

now when i want to use this i am doing like this

<p style="font-family:Simpletext ;">Lorem Ipsum is simply dummy text </p>
<span style="font-family:Simpletext ;">Lorem Ipsum is simply dummy text</span>

Now instead of repeating this will someone guide me how can i define it just like a class rule and reuse it like this

 <p class="Simpletext"></p>

1 Answer 1

2

This is regular CSS. Please check a tutorial or similar. This does not apply to @font-face

<style>
    .your-class {
        font-family:"Simpletext";
    }
</style>
<p class="your-class">Lorem Ipsum is simply dummy text </p>
<span class="your-class">Lorem Ipsum is simply dummy text</span>
Sign up to request clarification or add additional context in comments.

5 Comments

and if there is already a class implemneted like this <ul class="nav" > so how can i implement second class so same nav ?
@Sikander, that’s a different question and should be asked separately, with due facts disclosed, if it is really a problem. You don’t “implement” classes, you just write CSS rules that refer to classes. There is no obvious reason why rules for one class would affect rules for another class, so you would have to explain what the problem really is.
@JukkaK.Korpela i am using bootstrap and used <ul class="nav" > now when i want to apply custom bold font class to same ul how will i do it thats the problem . i did not know how to do that wnhen julian told me now i have to implement it in ul that is already imolementing nav class
@Sikander, as I wrote, that’s a different problem, but it seems to be a rather trivial one: just use <ul class="nav your-class">.
Or write CSS code like .nav { font-family:"Simpletext"; } !!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.