Skip to content

Tag: css

Increase height of Container

I am trying to increase the height of the main body area on my hosted website i.e. the gradient to fill the space below the button as well. Link – https://surijatin.github.io/covid-second-dose/ Github Repo – https://github.com/surijatin/covid-second-dose I have tried adding the height: 100vh to th…

Randomize color pairs onclick (CSS, JavaScript)

There is a button on my website that should change the page’s background color and the headline text color onclick (simultaneously). What makes it more complex is that the possible color pairs (BG + headline) should be pre-determined, but the pairs themself should be randomized, so each time you click t…

Generating new buttons from one with JavaScript

I have written a post about this problem Want buttons be displayed ONLY when clicking on another button with JS and I have not gotten a satisfying answer. I formulate my problem again. I have to find a right JS code to solve this issue. I have a set of buttons (“Backgrounds”, “Ears”, &…

API accessing certain values from data with JavaScript

I have the following API Data: And here is my code with a fake API code: All I would like to do is get the changesPercentage and display it on my webpage with HTML and CSS. I will have various data from different companies, so a versatile solution would be very helpful. Answer You’re trying to get chang…

“Button” shrinking after applying JS function

I am trying to build a timer. I am in the process of coding the play and reset button. It seems to work well, except that the “button” for the play or reset button would shrink after I clicked it once, and a refresh is needed to make it the original size again. I have tried to see if there

getSelection().focusNode inside a specific id doesn’t work

I have code to bold/unbold scripts via Window.getSelection() I got it from this answer: Bold/unbold selected text using Window.getSelection() It really works without problems . But when I looked for another code to make the selection inside a div specified with id I found this answer : How to getSelection() w…