I’ve created 2 sets of radio buttons (just to test different ways of presenting them). In the 2nd set (where I present them via an <ul>), I’m trying to use a selector to float the buttons left.
But the buttons remain to the right of the label What am I doing wrong there?
You can’t mix floats in the way you want. Float is an alternative now. Back when it was the way it wasn’t mixed with li. you might float an entire menu right or left, but usually not. It seems that on FCC people try and use grid and flexbox and position and float. Pick one technique and use that.
I don’t know, personally, I only use floats for their intended purpose (which they still do well).
However, there are times where using a float can do the job, like in the case of putting the radio button on the left of the label text. I probably wouldn’t do it but it isn’t like making a full-page layout using floats, it’s just on single elements and that can still work out fine I think.
Thanks for all your help. I see what I was doing wrong. I fixed that, and now the buttons are on the left side as I wanted, but also now looks like this:
Sorry I made the change now. I’m using Codepen through my browser so I would think it would always be updated? Here’s the pen. I saved the CSS change, but that is still happening:
I see that as well when I run it on a VM using lambdatest.
Do see it here:
macOS Mojave
Chrome 73
Do not see it here:
macOS Sierra
Safari 10.1
Does it happen with Safari and Firefox as well on your system?
I do not have enough free usage time on lambdatest to do any testing and I don’t have enough hands-on experience with Mac OS and Chrome to give you an answer right now, but I’m tempted to just say don’t use floats. Without being able to test it is kind of hard for me to come up with a solution.
Thanks for checking into it. I’m not too worried about it. Honestly I’m probably getting too caught up in the micro-details right now anyway, still trying to learn HTML! From some of the other answers ^^^, it almost sounds like floats are an older way of position things?
-removing the radio class from the first <li> didn’t do anything.
-adding the radio classes back to all the <li> didn’t do anything either.
-this is basically how the original example looks (I add borders to <div> sections to help me visualize them)
Maybe it could be something in the CSS. I’ve copied some of the examples CSS but not most of it. I’ve been messing around with some CSS elements but don’t want to go too deep- I just think there’s no point in tearing my hair out about styling right now, when I barely understand the HTML elements…
Sorry I didn’t see your reply. It is often better to use the reply button or use @username that way people are notified when you reply to them, just FYI.
Anyway, thank you for answering my questions. It looks like a bug to me, but that doesn’t matter. And you are right, don’t get too bogged down in specifics. When first starting out it is much too easy to get pulled into rabbit holes and trying to understand everything in detail.
Based on some of your threads I’d say you have a good eye for detail and that will serve you well. Not everyone just starting out will find bugs in the example code (they have been there for a long time) and you have now done so more than once. So keep up the great work.
BTW one quick “housekeeping” question- what is the etiquette with the “solution” button? Sometimes I’ve asked questions and the first reply was helpful, but then another reply was more helpful… So I don’t want to hit “solution” too soon (because then maybe no one else will respond?). But I also don’t want to annoy people. But maybe people aren’t that worried about it?
It is totally up to you if you even want to use the solution feature. There should be no pressure to use it.
It may be useful when you feel that a thread has run its course and you would like to not receive any more replies or just to mark it as resolved. If you want to mark a thread as resolved you can even just give it to yourself.