Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 357183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:10:54+00:00 2026-05-12T12:10:54+00:00

Is it possible to apply a css(3) style to a label of a checked

  • 0

Is it possible to apply a css(3) style to a label of a checked radio button?

I have the following markup:

<input type="radio" id="rad" name="radio"/>
<label for="rad">A Label</label>

What I was hoping is that

label:checked { font-weight: bold; }

would do something, but alas it does not (as I expected).

Is there a selector that can achieve this sort of functionality? You may surround with divs etc if that helps, but the best solution would be one that uses the label ”for” attribute.

It should be noted that I am able to specify browsers for my application, so best of class css3 etc please.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T12:10:54+00:00Added an answer on May 12, 2026 at 12:10 pm

    try the + symbol:
    It is Adjacent sibling combinator. It combines two sequences of simple selectors having the same parent and the second one must come IMMEDIATELY after the first.

    As such:

    input[type="radio"]:checked+label{ font-weight: bold; } 
     //a label that immediately follows an input of type radio that is checked 
    

    works very nicely for the following markup:

    <input id="rad1" type="radio" name="rad"/><label for="rad1">Radio 1</label>
    <input id="rad2" type="radio" name="rad"/><label for="rad2">Radio 2</label>
    

    … and it will work for any structure, with or without divs etc as long as the label follows the radio input.

    Example:

    input[type="radio"]:checked+label { font-weight: bold; }
    <input id="rad1" type="radio" name="rad"/><label for="rad1">Radio 1</label>
    <input id="rad2" type="radio" name="rad"/><label for="rad2">Radio 2</label>
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to have a css style be aware of whether the element
I have a given markup that I'm trying to apply to some style on.
Am I missing something. I have the following CSS: <style = text/css> .sidebar_qustions {padding:
Is it possible to create a CSS rule that would apply a style to
Is it possible to make the following in CSS: #subMenue { //this rule apply
Is it possible to apply a CSS(3) effect when the browser has scrolled? I
Is there any possible way to apply more than CSS to a control through
I am wondering if it is possible to style my VB.net application with CSS
With the following code below I want to be able to apply a CSS
I have a DIV to which I want to apply a style currently prescribed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.