简体   繁体   中英

How to change text beside its checkbox without any tag?

Here is my code:

<div style="float:left; min-width: 20%; ">
    <input id="Select All" class="search_init checkbox_filter" type="checkbox" value="Select All" name="EnquiryType" />Select All
    <br />
    <input id="Extra Works" class="search_init checkbox_filter" type="checkbox" value="Extra Works" name="EnquiryType" />Extra Works
    <br />
</div>

Now I want font weight to bold of checkbox's text. It would be like Select All and Extra Works

Please keep in mind you don't have to right any tag on the text. You can use checkbox Ids only. Thanks in advance.

I am not experienced in front end development, but I believe you can have something called "CSS Style sheets".

With these style sheets you can explicitly state that for any input tag, you want a certain type of style.

I highly recommend learning about style sheets at: http://www.w3schools.com/css/default.asp

They provide great examples and may help you not only for this, but for the future as well.

Add 'font-weight' to div. See this-

<!DOCTYPE html>
<html>
<body>
<div style="float:left; min-width: 20%;font-weight:900">
    <input id="Select All" class="search_init checkbox_filter" type="checkbox" value="Select All" name="EnquiryType" />Select All
    <br />
    <input id="Extra Works" class="search_init checkbox_filter" type="checkbox" value="Extra Works" name="EnquiryType" />Extra Works
    <br />
</div>
</body>
</html>

采用

<div style="float:left; min-width: 20%;font-weight: bold; ">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM