Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to put all labels in bold with css

how do I make all labels such as : first name, last name, etc in bold, by using header only? thank you

 <form>
                <fieldset class="set1">
                    <legend class="set1">Music Lover's Personal information</legend>
                    First Name
                    <input type="text" name="firstname" value=""><br><br>
                    Family Name
                    <input type="text" name="lastname" value=""><br><br>
                    Gender:
                    <input type="radio" name="gender" value="Female">Female
                    <input type="radio" name="gender" value="male">Male<br><br>
                    What age category are you from?
like image 925
David Benalal Avatar asked Jan 28 '16 16:01

David Benalal


2 Answers

I would wrap each label in a label tag and then in CSS, with this code, you can get it:

form label {font-weight:bold}

Hope this helps you.

like image 136
Jorge Fosela Avatar answered Sep 28 '22 15:09

Jorge Fosela


If you are unable to change your HTML markup and actually use labels, or spans, or other tags to wrap your labels, then you'd have to do something like:

fieldset { font-weight: bold; }
fieldset * { font-weight: normal; }
like image 43
Morfie Avatar answered Sep 28 '22 13:09

Morfie