Relative Content

Tag Archive for javascripthtmlcssweb

Why are my simple addEventListener functions not working, except one works backwards?

So I’m new to javascript and new to coding. I am building a website or two just to learn while I’m building. I’m doing this locally on my laptop. I’m trying to make a button on my website, that when clicked toggles a class name on an element. I did this once already but I’m trying again now, and it just wont work. I’ve tried a function declaration and an arrow function too. Here are my functions.

how to mis align two divs in css

so basically i have a mobile and desktop design with css, my mobile design is also my desktop design ,and despite it fitting it isn’t truly mobile ergonomic. I change the css when a certain width of px is decreased using media queries. https://jsfiddle.net/9h0pcz7g/1/ below is the simple html and css code, im wondering how i can make the green div on the right ontop of the coral div so it is in order like div’s normally are instead of in-line together. When i remove the inline bet however it seems to put the div on the right at the bottom instead of the top, i cant swap them around because it would mess up the layout and float:left/right doesnt work. anyway i can fix the second div on the right to the top?

CSS Circular Button

When a use border-radius:50%; the element becomes circular.
But it catches events on the cliped part that is no longer visible after using border radius.