CSS - Css Mouseover Image Not Showing
I am having trouble with my CSS mouse over links. XHTML and CSS3 both validate. However the large image for the mouse over isn't showing. I have check everything I can think of and still am totally unable to figure it out. It has been years since I have built a web page and am trying again so this site has not been published as of yet but is still accessible to look at. Below is the link to my site and the external CSS style sheet. I also have CSS code on the XHTML page as well. Could someone please take a look and see what I am over looking?
Thank You Selena I made a mistake.. I'm not a student. simplyselena.com and external style is simplyselena.com/css/styles.css Sorry the above is the only way I could put url in not allowed to post url's as I am a new user account. Similar TutorialsI have several small images in a row. Mouseover on each changes them to different image. However, trying to achieve paragraph of text to appear below this row - differerent <div> of text depending on which image is hovered over. My trial so far uses code below. (a) am I correct in saying I can achieve what I want with only CSS? (b) I know it's got something to do with hiding and showing a block?!? Suggestions appreciated. Thanks. <style type="text/css"> div.image1 { background: url(image1.jpg) no-repeat top left; width: 100px; height: 100px; } div.image1:hover { background: url(image1_hover.jpg) no-repeat top left; width: 100px; height: 100px; } </style> <div class="image1"> </div> Greetings I'm sure if I was cleverer I could figure this out for myself, but... Also if I could figure out what the last person who more than likely already got an answer about this topic called it in their post, I might have found it in the search, but... So, what I'm trying to do is this: I have a grid of images that link to a series of pages. To the right there is a standard navagation menu that also links to the same pages, and has a hover background color. What I (and by "I" I really mean the person who I am building this for, since I wouldn't do it this way, but...) want to have happen is that when you mouseover the images they highlight the corresponding links in the navagation menu. here is the css: Code: // the image grid #left { float: left; height: auto; text-align: center; width: 810px; } #left ul { padding: 0px; list-style-type: none; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; } #left img { border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; } #left ul li { text-align: center; width: auto; float: left; margin-right: 15px; height: 200px; margin-bottom: 15px; } #left ul li a { text-decoration: none; color: #000000; display: block; } // the nav menu #right { height: auto; width: 150px; float: left; } #right ul { width: 150px; list-style-type: none; margin: 0px; padding: 0px; float: right; } #right ul li { text-align: right; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-transform: uppercase; } #right ul li a { text-decoration: none; color: #000000; line-height: 38px; width: 135px; display: block; padding-right: 15px; } a.home:hover { background-color: #C6CED0; } a.bio:hover { background-color: #B4C2A1; } a.gallery:hover { background-color: #B4B281; } a.review:hover { background-color: #9A8F62; } a.current:hover { background-color: #AF8459; } a.past:hover { background-color: #AA8050; } a.contact:hover { background-color: #8A9B93; } ...and here is the html: Code: <div id="left"> <ul> <li><a href="gallery_landscape.html"><img src="images/new_landscape_sm.jpg" alt="New Landscape"></a></li> <li><a href="#"><img src="images/new_landscape_sm.jpg" alt="New Landscape"></a></li> <li><a href="#"><img src="images/new_landscape_sm.jpg" alt="New Landscape"></a></li> <li><a href="#"><img src="images/new_landscape_sm.jpg" alt="New Landscape"></a></li> <li><a href="#"><img src="images/new_landscape_sm.jpg" alt="New Landscape"></a></li> <li><a href="#"><img src="images/new_landscape_sm.jpg" alt="New Landscape"></a></li> </ul> </div> <!--end left --> <div id="right"> <ul> <li><a class="home" href="armin.html">Home</a></li> <li><a class="bio" href="#">Landscape</a></li> <li><a class="gallery" href="#">Plein-Air</a></li> <li><a class="review" href="#">Non-Objective</a></li> <li><a class="current" href="#">The Figure</a></li> <li><a class="past" href="#">The West</a></li> <li><a class="contact" href="#">Comics</a></li> </ul> </div> <!--end right --> Sorry for the long post, but I hope that makes sense... Thanks in advance for any help. Hi, I have a link and an image next to each other. I want to make the link hovered when I do mouseover on image. How do I do that ? Here is the code I have now. <a href="javascript:undefined" id="imageLinkId">GMNA</a> <script language="javascript"> if( ... ) { document.write('<img src="/graphics/channel/plus.png" id="div18Img" alt="Maximize this section" onMouseOver= >'); } else { document.write('<img src="/graphics/channel/minus.png" id="div18Img" alt="Minimize this section" onMouseOver= >'); } </script> Thanks Have some (for me) a mysterious problem when mousing over an image inside a div. I use javascript to change the class of a div when either onMouseOver or onClick of the div. If I use onMouseOver to change the class of the div then the mousing over the image inside div is working fine. If I use onClick to change the class of the div then the mousing over the image inside div is NOT working fine. Why is that? Is there a way to make it work as I want? Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta name="Keywords" content="div, bug, onmouseover, onclick, image, "> <meta name="Title" content="DIV onmouseover bug"> <meta name="Description" content="onmouseover over image inside DIV causes div onmouseout event to fire"> <title>onClick event of DIV causes mouseover of image in second example to make DIV hidden</title> <style type="text/css"> body { margin:0; padding:0; } .esmall { display:block; z-index:2; position:absolute; cursor:pointer; height:20px; width:300px; border:0; background-color:#a44; font-family:arial,sans-serif; font-size:12px; color:#fff; overflow:hidden; } .elarge { display:block; z-index:3; position:absolute; cursor:pointer; height:auto; width:300px; border:1px solid black; background-color:#fff; font-family:arial,sans-serif; font-size:12px; color:#000; overflow:hidden; } </style> </head> <body> <div id="div1" class="esmall" onmouseover="this.className='elarge'" onmouseout="this.className='esmall'" style="left:10px; top:50px;"> <div style="display:block; margin:2px;"> MouseOver this div.<br><br>Then try to mouse over the image or the square below. Here it should work fine<br><br> <img src="event-edit.gif" alt="Edit" onclick="alert('Run som function here')" title="" border="1" height="15px" width="15px" style="background-color:red"><br><br> </div> </div> <div id="div2" class="esmall" onclick="this.className='elarge'" onmouseout="this.className='esmall'" style="left:320px; top:50px;"> <div style="display:block; margin:2px;"> Click here. Then try to mouseover image inside DIV<br><br>Then try to mouse over the image or the square below.<br><br> You will see that mousing over image causes the DIV to get its original size, as if you moved the mouse outside the div.<br><br> The only difference between the two divs a First DIV uses onMouseOver and second uses onClick<br><br> I would like this one to work but without the div dissapearing when I mouseover/mouseout of the image below.<br>How do I make it work?<br><br> <img src="event-edit.gif" alt="Edit" onclick="alert('Run som function here')" title="Try to click me if you can" border="1" height="15px" width="15px" style="background-color:red;"><br><br> Tested in: FF, IE, OP NE<br><br> I use the nested divs to cope with some differences in padding behaviour between the browsers. It does not affect what I'm trying to do. </div> </div> </body> </html> Hi. I have just recently begun working with CSS. Is it possible with CSS (and without the use of any JavaScript) to have the background image change on a link mouseover? I have the first image below (blue.jpg) set as my default background image and would like the second image (blue1.jpg) to display when the user hovers over a particular link. URL URL Thanks for any help anyone can offer On my site I have a list of links on the left side. I keep them in an unordered list, and set the background image using css. I want to change the image on rollover. In Firefox I can just change it putting by :hover after an li in the style sheet as if it were an anchor, but IE won't accept that, and for some reason I can't get the style to change using javascript either. Any help appreciated- I know it's something really simple that I'm just not seeing. IE also won't display the hand cursor, but if I figure out how to get the image to change I can do the hand on my own at the same time. Firefox does everything right, so you can use that to see what i'm going for. Hey everyone. I'm trying to create a cool menu system for my site and I wanted it to be images only. Its he - http://www.how-to-pass.info/topf2.html I wanted this to have cool mouse over images, as well as displaying drop down menus. Unfortunately, there are two problems: 1. Mouseover images don't display 2. Drop down menu disapears when you move over the menus. Can anyone tell me how I can get this to work in a simple way? I dont much hardly anything about style sheets and javascript etc. Many Thanks. I have an image in div that is on z-index layer. I did this to avoid cutting it up in smaller images. I finally got it to position correctly in my layout, now it won't show in FF. here is a link to the page in progress: http://www.rustbug.com/the19thhole/index.html Any suggestions? Hi everyone, I have a design I am working on a design, which has a image for a background, well the image does not show, I am not sure why, it just shows white text. Anyway here is my code. Code: #logo{ background-image: url('logo.png'); background-repeat: no-repeat; } #logo .text{ letter-spacing: -0.1em; font-weight: bold; font-size: 21px; text-align: left; color: #FFFFFF; } That does not work, however, this does. Code: <img src="logo.png" alt="Logo" /> Any suggestions? The only way i can get my backgroud image to show is to explicitly state my body elements within each document. If I put them in css file and refer each page to that css file, my background image does not work, but all the other elements in that css file do. Why? JOhn I'm using the "hacked" version IE6 since I have IE7 installed. I designed a web page with a really strange problem. I've created a "div popup" that shows an image and some text when you click on a link but the image doesn't appear in IE6 until you right click and choose "show picture". And even then, the combo box in the background still shines through. Any suggestions? wwwDOTstoneycreekrentalsDOTcomSLASHequipmentDOTasp (Then search for dozers) Here's the CSS I'm using: Code: div#popup { background-color: black; color:white; display:none; font-size:small; margin-left: auto; margin-right: auto; padding:5px; position:absolute; text-align:center; width:736px; z-index:1; } And my javascript: Code: <script type="text/javascript"> function popupDiv(str){ var popup = document.getElementById('popup'); popup.style.display='block'; popup.style.top=27+'px'; popup.style.zIndex=1002; popup.innerHTML = str + '<br /><a href="javascript:void(0)" onClick="document.getElementById(\'popup\').style.display=\'none\'">Close</a>'; } </script> For some reason no matter how I structure the code, I cannot get a background image to show up and I'm not sure why. Here is my current code:
Code: background: #cccccc url(/dir/bg.png) repeat-y; I've checked multiple sites just to verify that my code is correct, and it is. I've also tried the code another way: Code: background-color: #cccccc; background-image: url(/dir/bg.png); background-repeat: repeat-y; The image is uploaded to the correct directory as well. Any ideas? I'm working on a website that I'm having issues with in the CSS. I'm fairly new to CSS and I don't know how to get an image banner to show up next to each other. I though with the css in place I could do that, but some how I'm missing where the nav drops down in to the next div which is suppose to be a slideshow type div. The page is at ukindesigns.com/EBB/ebb.html and the style sheet can be found at ukindesigns.com/EBB/CSS/style.css Thanks, Franky Hey everyone, I am making a design for my site, and when I use a rounded image for my background, IE shows a whitespace around it. Here is my code. Code: #menu_outer { background-image: url( menu1.png ); background-position: top left; background-color: #0000000; width: 250px; } Here is an example. Any suggestions? I have an image gallery, that when the thumbnail is hovered over a larger image appears. This works fine in Firefox and IE but not in Safari. I have validated my code and css. The gallery is at http://www.briandobson.com.au/sthaust.html Code: <tr> <td valign="top">Boat Harbour, Goolwa<br /> 75 x 35cm <br /> $720</td> <td valign="top"> </td> <td> <a class="thumbnail" href="#"><img src="SthAust/thumbs/Boat-Harbour---Goolwa.jpg" alt="Boat Harbour, Goolwa" width="200" height="46" /> <span> <img src="SthAust/Boat-Harbour---Goolwa.jpg" alt="Boat Harbour, Goolwa" width="775" height="248" /> </span> </a> </td> </tr> CSS is in the head and separate styles.css Code: .thumbnail img { border: 1px solid white; } .thumbnail:hover { background-color: transparent; float: left; } .thumbnail:hover img { border: 1px solid white; } .thumbnail span { position: absolute; background-color: white; padding: 1px; left: -1000px; border: 1px solid black; visibility: hidden; color: black; text-decoration: none; display: block; } .thumbnail span img { border-width: 1px; } .thumbnail:hover span { visibility: visible; background: top; left: 0px; z-index: 50; } With thanks Angela hello. this has us stumped. here is the page: http://www.praxishosting.com/dev/csstest/testindex.htm it looks fine in IE, but in firefox, the div tag containing the background image does not appear to be expanding as the content grows. thus in firefox, you cannot see the background image in the bottom left hand cell (the only place it shows through). any suggestions? the style code for the background container is rather simple: Code: #container { width: 750px; background: url(../media/bkgrd.gif) repeat fixed center top; margin-right: auto; margin-left: auto; height: 100%; } CSS back ground image isn't showing at all. Tried everything, googled, flipped through CSS books, moved the image into different directories, drank more tea and finally flipped Help! Site link : http://weary.me.uk/MT/ Code: * { margin:0; padding:0; } BODY { background-color:#FFFFFF; font-size:12px; } #header { background-color:#FFFFFF; padding:0px; } #left { float:left; width:18%; padding:0%; margin-left:1%; margin-top:0%; } #right { background-image: url(right_background.jpg); background-repeat: no-repeat; margin-right: 20px; width: 220px; border:1px solid #d2d7e4; float:right; width:20%; margin-right:0%; margin-top:0%; padding:0px; } #center { margin-right:30%; margin-left:14%; padding-left:10%; background-color:#FFFFFF; } #footer { clear:both; background-color:#FFFFFF; padding:8px; } |