Jump to content

Few CSS questions.


ultranova6600

Recommended Posts

Hi, I have a question regarding css property :hover. I saw on some pages that when you hover over a button it changes a color. Let's use this button as example: facebook-icon.gif Let's say I want that a blue part changes a color on hover. How do I do it? My idea was to make other icons in photoshop with different style and put in hover like

:hover{background: url('example.png')}

Is there another way to do it in CSS like changing the text/background color on hover?Can elements control other elements (for example I want that when I hover over element1 that element 2 changes color?) or I need some browser scripting language for that? And whats the difference between div and span?

Link to comment
Share on other sites

CSS image sprites are the most common way to do this: http://w3schools.com...age_sprites.asp <div> is block element, <span> is an inline element. Block elements take up the full width of their container and push content that follows it below. Inline elements can go within text without changing the flow of the page.

Link to comment
Share on other sites

Can elements control other elements (for example I want that when I hover over element1 that element 2 changes color?) or I need some browser scripting language for that?
Yes, hovering on element 1 can change the style of element 2. Provided that element 2 is a descendant or sibling of element 1. If element 2 is a parent or completely unrelated to element 1, you'll need to use JavaScript.
Link to comment
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
×
×
  • Create New...