Jump to content

HTML/CSS Help!

Peeeeeeeeeeynk

Hi guys I wanna ask a question on how can you replicate this effect like when you hover on a logo the color changes for example this site when you hover the logo on the top left, the colors change http://designmodo.com/.

May I ask on how do you achieve this?

 

Thanks in advance!

:)

Link to comment
Share on other sites

Link to post
Share on other sites

Ok, what you want is the hover CSS property. Take the example below. We have a div with an ID of "lol" and we are applying CSS to that div that changes the font colour to orange and the background colour to blue. Then when we target the same div with a :hover appended to it, it reverses the colours. Rather than colours, you could have a background image and on hover you can change the image. Things like that.

<div id="lol">This is a div, but this can really be anything to be honest. This can also be an image, like that logo, that changes using the hover thingy</div>
#lol{	color: orange;	background-color: blue;}#lol:hover{	color: blue;	background-color: orange;}

Note that you cannot use :hover as inline css

I am good at computer

Spoiler

Motherboard: Gigabyte G1 sniper 3 | CPU: Intel 3770k @5.1Ghz | RAM: 32Gb G.Skill Ripjaws X @1600Mhz | Graphics card: EVGA 980 Ti SC | HDD: Seagate barracuda 3298534883327.74B + Samsung OEM 5400rpm drive + Seatgate barracude 2TB | PSU: Cougar CMX 1200w | CPU cooler: Custom loop

Link to comment
Share on other sites

Link to post
Share on other sites

Ok, what you want is the hover CSS property. Take the example below. We have a div with an ID of "lol" and we are applying CSS to that div that changes the font colour to orange and the background colour to blue. Then when we target the same div with a :hover appended to it, it reverses the colours. Rather than colours, you could have a background image and on hover you can change the image. Things like that.

<div id="lol">This is a div, but this can really be anything to be honest. This can also be an image, like that logo, that changes using the hover thingy</div>
#lol{	color: orange;	background-color: blue;}#lol:hover{	color: blue;	background-color: orange;}

Note that you cannot use :hover as inline css

And to make it a smooth transition he should  add

 

-moz-transition: all .3s ease;

-webkit-transition: all .3s ease;

-o-transition: all .3s ease;

transition: all .3s ease;

 

to #lol

 

Also OP it doesn't need to be an ID you can use a class or element for this.

i want to die

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×