Let's denote the number of boys as \( B \). According to the problem, the number of girls can be expressed as \( B + 148 \) (since there are 148 more girls than boys).
The total number of students is the sum of the number of boys and girls, which is given as 518:
\[ B + (B + 148) = 518 \]
Simplifying this equation:
\[ 2B + 148 = 518 \]
Now, subtract 148 from both sides:
\[ 2B = 518 - 148 \] \[ 2B = 370 \]
Now, divide both sides by 2:
\[ B = \frac{370}{2} = 185 \]
So, the number of boys in the class is \( \boxed{185} \).
Thus, the correct answer from the options provided is B. 185 boys.