skip to Main Content

I’m using a plugin in wordpress that creates the following html:

<div class="tmm_names">
    <span class="tmm_fname">Name</span> 
    <span class="tmm_lname">Surname</span>
</div>
<div class="tmm_job">Job title</div>

I need to bold the content of class "tmm_job" using css. I don’t have the option to change the html code so I need to make this change through css.

I’ve tried the following but it does not work:

.tmm_job {
   font-weight: 900;
} 

When I tried to change the span class font-weight it worked, but for div class no. Any ideas?

3

Answers


  1. If you just want to increase font-weight simply use inline CSS

    <div class="tmm_job" style="font-weight: 900;">Job title</div>
    Login or Signup to reply.
  2. I ran your code and it worked fine for me, the files themselves work perfectly. Have you checked the href link to the .css file? As long as the main.css file is in the same directory, it should work just fine.

    <!DOCTYPE html>
    <html>
        <head>
            <link rel="stylesheet" href="main.css">
        </head>
        <body>
            <div class="tmm_names">
                <span class="tmm_fname">Name</span> 
                <span class="tmm_lname">Surname</span>
            </div>
            <div class="tmm_job">Job title</div>        
        </body>
    </html>
    
    .tmm_job {
        font-weight: 900;
     }
    
    Login or Signup to reply.
  3. use this:

    .tmm_job {
       font-weight: 900 !important;
    } 
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search