What is the best way to place the radio button next to the label?

I'm struggling to align the radio button next to its label in my form. The circle is quite large and always seems to be centered with a bigger size, taking up an entire line. I believe the issue lies with the width settings. I've tried separating the radio button but it still doesn't seem to work.

form {
  width: 60vw;
  max-width: 500px;
  min-width: 300px;
  margin: auto;
  padding-bottom: 2em;
  background-color: #1b1b32;
  padding-left: 25px;
  padding-right: 25px;
  border-radius: 5px;
  margin-top: 15px;
}

input,
textarea,
select {
  margin: 10px 0 0 0;
  width: 100%;
  min-height: 2em;
  border-radius: 5px;
  border: none;
  margin-bottom: 20px;
  margin-top: 5px;
  padding: 5px;
}

fieldset {
  border: none;
  padding: 2rem 0;
}
     <p>Would you recommend this to your friend?</p>  
    </fieldset>
    <fieldset>      
      <label><input type="radio"/>Yes</label>
    </fieldset>
  </form>

</body>

Answer №1

It would be beneficial for you to put in some effort and do a quick Google search

<label for='inp'>Yes</label><input id='inp' type="radio"/><br>
<input id='inp1' type="radio"/><label for='inp1'>Yes</label>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Having trouble making the menu stay at the top of the page in IE7

Check out the demo here: http://jsfiddle.net/auMd5/ I'm looking to have the blue menu bar stay fixed to the top of the page as you scroll past it, and then return to its original position when scrolling back up. This functionality works in all brows ...

Setting the Minimum Height and Enabling Scrolling for Divs

Just wondering if this is achievable, so I thought I'd inquire. I've got a div layout with two columns inside a container. They're aligned using inline-block and percentage widths. The basic structure looks like this <div id="containte ...

Transform a list element into three separate rows using Bootstrap

I need assistance wrapping a list of elements into 3 columns using a single <ul> Here is a visual representation of what I am aiming for: https://i.sstatic.net/dptO2.png <ul class="list-group list-group-flush row-cols-3"> <li ...

What is the method for aligning navbar items to the right in Bootstrap 4?

I'm new to Bootstrap and I have a question about aligning navbar items to the right in Bootstrap 4. I've tried the solutions provided in this article Bootstrap 4 - Right Align Navbar Items, but they didn't work for me. I'm trying to un ...

Tips for passing down CSS styles through Less stylesheets

In an effort to create a legend below a <table> that matches the colors defined in Bootstrap stylesheets, I am struggling with the following: .table > thead > tr > td.warning, .table > tbody > tr > td.warning, .table > tfoot ...

The functionality of the button in my script is limited to a single use

Below is a simple code snippet that I wrote: HTML & CSS: <!DOCTYPE html> <html> <head> <title> JavaScript Console </title> <style> button { text-align:center; ...

issue encountered while attempting to load a previously saved game

I recently developed a puzzle game and added a save system, but I encountered an error while trying to load the saved data: Check out the website here And this is the saved file Here's the code snippet that is executed when loading the saved data: ...

Stop unauthorized access to PHP files by utilizing AJAX

Is there a way to prevent direct access to a specific PHP file named prevented.php? My approach involves a main file called index.php, which generates and stores a token in a $_SESSION variable. Additionally, there is another file called def.php that is ac ...

Is there a way to prevent users from copying data or switching tasks when using my program or website?

Is it feasible to develop a website or application for Windows desktop machines that can remain focused until the user completes a specific task? For instance, if my YYY app/website is open and I require the user to input some text, I want to restrict the ...

Tips for aligning elements vertically within a <td> tag

I am looking to vertically align 3 elements within my <td> tag, specifically in the center/middle. These are the elements I want to align: An image button (a tag) with a top arrow image A jQuery slider Another image button (a tag) with a bottom arr ...

PHP code for sending a file alongside displaying text on the browser using the echo command using X-SendFile

I am currently utilizing the X-SendFile Apache Module to facilitate the download of large files from our server. The downloads are functioning as expected; however, I am faced with an issue regarding outputting text to the browser when a download is initia ...

Issue with Razor-generated HTML Checkbox and Bootstrap 4 causing checkbox to consistently submit as false

I am encountering a problem with the implementation of the Html.CheckboxFor() function in an MVC .NET 5 application. The Razor code snippet is as follows: <div class="form-group"> <div class="form-check"> &l ...

What is the most effective method for starting an application from a web browser, regardless of platform or browser used?

Forgive me if this question has been asked before in a similar way. I have multiple test applications that operate on different platforms such as Windows 95, Windows XP, SUSE, RedHat, and other variations of UNIX. Currently, the process involves a native a ...

Contrasting the process of generating DOM elements by using createElement, setting properties, etc., versus constructing a string of elements and then appending them

I am curious about the distinction between these two methods for creating HTML elements. I cannot seem to find any difference. I simply want to understand if there are any variations based on performance or any other factors. The first technique involves ...

Struggling with showcasing database information in HTML using Node.js and Sequelize

In the server.js file, I have the following code: TABLE .findAll({ raw: true }) .then(function(asd) { console.log(asd); }); This code displays all data from my database in the console. Now, my question is: how can I display this data on my website? ...

What causes the form to vanish when using the ngFor directive?

Whenever I use the ngFor directive within a form tag, the entire form seems to disappear. Does anyone have any advice on how to resolve this issue? <form #myforms="ngForm" *ngFor="let i of editaddress"> <div class="p-3 p-lg-5 border"> < ...

Tips for dynamically injecting HTML content in an Angular web application

I'm currently working on an angular website dedicated to a specific book. One of the features I want to include is the ability for users to select a chapter and view an excerpt from that chapter in HTML format. However, I'm facing a challenge wh ...

Styling only for Angular 2 Components

How can component scoped styles be used to style elements differently based on their location within the site while still maintaining style scoping? For example, when using a "heart like" item created in this course, how can padding be added specifically i ...

What are some effective ways to resize the fontawesome glyph icon on my twitter-bootstrap website while maintaining proper alignment?

Are you able to figure out the code change needed on this under construction web page? There is a white box next to the company name at the top left, check it out here The site is twitter-bootstrap based with a white box "glyph icon" from FontAwesome. I&a ...

I'm interested in concealing a div by resizing the window

Attempting to conceal a div using jQuery, I implemented the following code: $(window).resize(function(){ if ( window.innerHeight < 750 ) { $("footer").animate({'height' : '0px'}, 500); } if ( window.innerHeight > 750 ) ...