0
Why can't I move buttons
I use div around button and give it an ID and use css to move button but it's not working. Any ideas can help
13 ответов
+ 2
Css element should not have Space between type and name. Replace # a by #a.
+ 2
Rad idea to do the classic Game Gear! I've changed some stuff, see if that helps you.
https://code.sololearn.com/WQmSj9cCgUss/?ref=app
+ 1
Show your code please
+ 1
Hi Ryan, to share your code, it's better to hit the plus button and attach it. Or in the top corner, there are 3 dots, hit that and choose share, then copy the link and paste it in your post.
I believe your problem is the second "relative" you have.
Read this and see if it helps:
https://developer.mozilla.org/en-US/docs/Web/CSS/position
+ 1
https://code.sololearn.com/W97pAdE63zl1/?ref=app
+ 1
It was the spaces. Yeah trying make a game console with different games once get everything set up it be lots js.
+ 1
Thanks everyone.
+ 1
make the div relative position and the button at absolute position then the direction to be move
+ 1
If each button will be unique, you want an id not a class. You should need to div each on, just add an id to each button.
E.g. <button id="lefty">L</button>
+ 1
I checked your code, you have the div with the id, not the button. That's why the colour streaks out. The background of the div is bigger than the button.
I've updated mine above for you. You'll see the difference.
0
In html <div id=u><button>U</button></div> in css # u {position:relative; relative left: 40px;}
0
I am trying to customize buttons that will have different properties. Should I turn them into classes with dot notation or wrap in div alter by id's?
0
Thank you, that's how I have it. Having a hard time with commands working to alter. Think might be because I am on the phone programming instead of pc. Like using ex. #a {background-color:rgb(20,40,50);} this would streak out sideways instead of making button a color, or if I go to do radius nothing happens.