I would like to ask whether it's possible to have a code for image change on hover without CSS and without the function onmouseover
For my web, I need a simple html code, unfortunately, the eshop system does not support the onmouseover function
Is it possible?
Thank you very much
Related
So I'm definitely an amateur with HTML/CSS. I'm trying to edit an HTML template in various ways, and one of the things I'm stuck on is trying to change the background color of an active navigation tab. Where would it go? What string do I use? To be honest, I'm not sure I'm even asking the right questions or using the right terms since I'm so new to this. Half of what I've figured out how to do is by using "Inspect" on chrome to find out what the containers/etc. are even called.
I'd like to change the white to match the rest of the container below's background color of #fbf9f6, but only the one that's active.
I'd also like to change the background color of the selected icon to pink as well as the icon itself to white when active.
I'll mention that this code is only in HTML as far as I can tell, I don't think there's a CSS file for it since it was a template I copy and pasted. The website is Toyhouse if that helps at all.
This is what I'd like it to look like.
Here's the link to the code: https://codeshare.io/5e10QJ
First, It looks like you have all your styling in the HTML file. These styles should be removed and placed in a css file. Then, in your HTML file, you can use classes and ids to as selectors to style these elements.
In order to change the the color after an element has been active is by using pseudo classes. You can find information on that here.
https://www.w3schools.com/CSS/css_pseudo_elements.asp
So, basically I am trying to make an overlay for a website, like a sidebar, but I don't want the css of a website to interact with my HTML.
Up to now I tried to do that with the help of an iframe (in the foreground), but the user can't click through that.
The next thing I would try is to load the webpage into an iframe and my HTML as the actual website.
But I am certain that there is a more "clean" way to do what I am trying to do.
Well, the best approach to isolate styles, which is also suggested by the comments, is to just make use of the Shadow DOM to isolate styles. But of course, the simplest approach would have been to move the iframe out of the viewport and to just have an event handler on the parent window. If I remember correctly I had the event handler for the animation of the sidebar inside the Iframe itself which is why the event didn't propagate properly, and thinking back it's kinda obvious. But maybe this helps someone... 🙂
Like #Burhan suggested in the comments, here is a link to my repo with an example approach in vanilla Typescript using the Shadow DOM: https://github.com/grievouz/chrome-extension-sidebar-example.
And here is another one in Javascript using React and an Iframe: https://github.com/segmentio/chrome-sidebar.
I'm playing around with Active Desktop on an old WinXP machine.
I have my background set up with an iframe and links pointing it to certain folders to make it easier/faster to navigate. I'd like a link to change the background-image of the iframe without having to resort to make a new page everytime I find a new image I want as a background-image. While I have no clue how, I'm fairly sure it's something CSS ought be able to handle.
The catch is that Active Desktop refuses to run Javascript.
So is it possible to change the background image of a page by clicking a link without using javascript?
via CSS you could use the pseudo :hover
However, that would only last for as long as you hover. If I understand you correct, you want a permanent change of image without scripting, or just without JS? You could try WSH. Perhaps there is some useful function in there, or maybe VB?
Ok, so im creating a website and to make it look fancier, I need to make the image responsive to the mouse (i.e. when the cursor is over the image, when the image is click, etc.) Does anyone know the code or another way of doing it? I am using google sites. Thanks!
I would recommend using JQuery to select and add some actions to your images have a look at this tutorial it is quite good.
You can take the idea and change it to your liking.
I just had a question about how to change image and text on hover and click.
They are placed side by side and now I know how to swap them at the same time.
Now my follow-up question is: How can I make several of these Image&text to swap after one another?
Is it doable with css only? Or do i need to adddd some script?
If what you are asking is if you can swap them automatically, at a given interval of time, then the answer is yes, it is possible with CSS, using keyframe animations - you can animate the opacity property.
UPDATE: image gallery using keyframe animations
You can also do this when you have some kind of thumbnails or navigation buttons and in this case it's mostly the same technique I've used in my answer for your previous question - a very basic (ahem, very basic means I did it in a couple of minutes a couple of weeks ago and then I was too lazy to come back to prettify) example of this kind of gallery using thumbnails for navigation you can see here http://dabblet.com/gist/3102051.
You can use CSS :hover pseudo-class to change a background image (or change background position is using CSS sprites) on a hover event, but there is not a CSS-only way to do the same for a click event. You would probably need to look at javascript for this
Yes it is possible using CSS only. check this blog post for details:
http://sixrevisions.com/css/css-only-tooltips/. Can you also provide some sample code that will help understand how it can be done. Nevertheless, the link I mentioned above must be able to aid you.