skip to Main Content

I have multiple classes within the p tag, but I am not sure how to specify that I want to edit a certain class. These are someone of the lines that I have that need to be edited differently.
enter image description here

I need to make the first 2 lines into sans-serif.
What can I do to fix this confusion?

3

Answers


  1. I don’t quite understand the question. If you’re asking how to select an HTML element with a certain class within CSS, you can use class selectors. For example, the first two paragraph elements in your code have two different classes: "stageDirection" & "actor".

    To select them in CSS, you would enter this:

    .stageDirection {
      /* enter code here */
    }
    
    .actor {
      /* enter code here */
    }
    
    Login or Signup to reply.
  2. If you want to give different css effect in a paragraph, you can select those lines into a <span class=""></span> tag with you customized class name in the class attribute. And write your css codes accordingly.

    For sans-serif text use font-family: sans-serif;

    Login or Signup to reply.
  3. If you want to apply styles to a specific class of p tag, you should create/open .css file or write between <style></style> in html and write there:

    p.stageDirection {
      font-family: sans-serif;
    }
    

    p.stageDirection means that styles should be applied to p tag with class stageDirection

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search