I have 2 HTML pages, 1 CSS file, and 1 javascript file. On each HTML page, I have 2 buttons for the switch by the pages. When I press button 1 I go to page 1, when I press button 2 I go to page 2. I’m trying to change the button color when I switch from the page. Example:
Tag: css
Let 3rd party change styles of an iframe of my site
Let’s say I am hosting site2.com and have site2.com/frame.html file that is simple as this: Now say 3rd party website called site1.com wants to embed this content via iframe element like this: So I get this result in the Chrome browser when I open site1.com (ie. site1.com is playing the role of the 3rd …
Website javascript doesn’t work unless I’m using LiveServer on VSCode to load it?
Navbar toggle isn’t working? Javascript: HTML When I am using liveserver on VSCode the navbar menu created by this works perfectly, however when I simply open the file from my finder into the browser, the navbar no longer works? Here is the CSS in case that’s necessary: I’m just now getting …
Logo float on basic responsive nav
Problem ” float: right” poorly working in responsive class Basically, I am trying to place my image logo in the right-up corner for a semi-lang case but every manipulation on .logo force navigation bar to change its values. Question How can I align the logo to the right-up corner? What I’ve …
Wait for browser to render element in React
I’m using CSS transition with top and left to animate the movement of an element in React. To achieve this, the component must first be rendered with top: 0; left: 0, and then re-rendered with altered top and left properties to start the transition. This is my component: I expected the component to be r…
Modal Opening Unintentionally On Load
Hi there I am having problems with a modal I have implemented on my site where the modal is open upon loading the site, I wish to have it only open when the correct button is pressed. Additionally it is moving down all other divs below it even though I have the position as absolute and its parent div as
Slick Carousel showing vertical on mobile instead of horizontal
I have a Slick Carousel in my webflow site. Desktop, tablet works fine, but when I switch to mobile the items are stacked up in vertical order instead of horizontal. Interesting fact is that when I open chrome dev tools and squeze the width of the page to mobile, it works fine, but when I actualy use the Mobi…
How to set 4.5 stars with jQuery on page load?
I am trying to make sure that when the page is loaded, the rating is automatically filled with 4.5. There must be four and a half stars active (yellow) with jQuery. My code: What can I do in jQuery to give 4.5 stars to this? Answer The easiest method is to set the value directly in the HTML: using the
Styled component doesn’t override inline styles
I’m trying to override third party component inline style. I followed the doc how can i override inline styles So, I used &[style] to override the inline style but this is not working. The third party component I use is CookieConsent Right now, my component is looking like that: I also tried how can…
Using symbols in an input to format text
I’m struggling to find a solution which allows a user to input in a input field, however they can style their text when it displays after the input for was submitted. For example, a user could enter **message** into the input field, JavaScript can detect that the ** on the start of the word/sentence and…