HTML - In-line Navigation Images Rollover Capable
Hello everyone!
I'm diving head first into XHTML/CSS development. Up until this point I've been designing using only tables, background graphics, and PHP. I have seen the light so I'm now working with XHTML and am proud to say that what I've done so far is XHTML Strict valid! I took a look at phpbb.com's website and saw I really liked the layout and figured, what better practice than to create something like that, so I did! Unfortunatly I'm having trouble duplicating their method for the navbar. If anyone could point me in the direction of how to get the images all in the nav bar's div layer I'd be very thankful. Keep in mind it will need to be rollover/active/rollout classes capable. My website is http://xt-arts.com Thanks so much for your help!! Similar TutorialsHey guys, I'm a designer trying to code my website which is problem number 1. I'm trying to crreate these solid rollover states for my graphic headers on my nav (about and contact). I found a site that I plugged code from using javascript which i dont' know. The "about" link works fine but the "contact" link effects teh about link instead of targeting itself. Any help you can offer I would really appreciate. Thanks! here's my site: http://www.bru.us.com here's the code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>BRU</title> <link rel="stylesheet" type="text/css" href="bru.css" /> <script type="text/javascript"> var revert = new Array(); var inames = new Array('about','contact'); // Preload if (document.images) { var flipped = new Array(); for(i=0; i< inames.length; i++) { flipped[i] = new Image(); flipped[i].src = "nav/"+inames[i]+"2.gif"; } } function over(num) { if(document.images) { revert[num] = document.images[inames[num]].src; document.images[inames[num]].src = flipped[num].src; } } function out(num) { if(document.images) document.images[inames[num]].src = revert[num]; } </script> </head> <body> <div id="header"> <img src="images/logo_gold.gif" /> </div> <div id="navigation"> <IMG SRC="images/nav_header_design.gif"/><br> <a href="about.html"class="catlink">TowerGroup</a><br> <a href="about.html"class="catlink">PSR</a><br> <a href="about.html"class="catlink">Click&Buy</a><br> <a href="about.html"class="catlink">MCA</a><br> <a href="about.html"class="catlink">Incretin Forum</a><br> <a href="about.html"class="catlink">Mastercard</a><br> <a href="about.html"class="catlink">Baraclude</a><br> <a href="about.html"class="catlink">IconNicholson</a><br> <a href="about.html"class="catlink">FIFA</a><br> <br> <br> <IMG SRC="images/nav_header_other.gif"/><br> <a href="india_photos.html"class="catlink">India</a><br> <br> <br> <a href="about.html"> <img src="nav/about1.gif" name="about" onMouseOver="over(0)" onMouseOut="out(0)"> </a><br><br> <a href="mca.html"> <img src="nav/contact1.gif" name="contact" onMouseOver="over(0)" onMouseOut="out(0)"></a><br> </div> <div id="portfolio"> <IMG SRC="images/towergroupmarketing/tw_moodboard.jpg"/>     </div> <div id="description"> <h1>TowerGroup / Moodboard</h1> <p> When TowerGroup came to us and talked about what they felt differentiated them from other financial institutions, one thing that stood out to me, was that they wanted to communicate that they're analysts are hands-on and accessible. To express this concept in a website, I thought mixing hand-drawn illustrations with photographs would help give the site a more personable feel. </p> </div> <!--Content--> <div style="position:absolute; top:474px; left:499px;"></div> </body> </html> here is the css: #button { display: block; width: 109px; height: 89px; background-image: url(Images/button.png); background-repeat: no-repeat; } #button:hover { background-image: url(Images/buttonHOVER.png) } here is the html: <a id="button"> <!-- if there is a link then place a HREF next to the ID --> also if you want to preload the images then put this in the html: <img src="button.png" height="89" width="109" class="hiddenPic"> <img src="buttonHOVER.png" height="89" width="109" class="hiddenPic"> and this in the head: (only put this in your head if you are pre loading the images) <style type="text/css"> .hiddenPic {display:none;} </style> I'm about to rip my hair out on this one. I'm using Dreamweaver 8. I have navigation that is using image rollovers to swap. My images that are needed for the rollover to work are in my "assets" folder in the "root" directory. However, when I create the actual html page off the template it is looking for the image in "templates/assets" and therefore does not find the image to swap. I have a number of different navigation buttons and I inserted them all the exact same way. This is the only one that is having this issue, the rest work properly. This is the code that resides on the templates page. Code: <p class="navimage"> <a href="../logset.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Log & Grate Set','','..assets/menu/log_over.jpg'',1)"><img src="../assets/menu/log_default.jpg" alt="Log & Grate Set" name="Log & Grate Set" width="158" height="34" border="0" id="Log & Grate Set" /></a></p> Notice the Set','','..assets/menu/log_over.jpg. This is the code that is produced when you create an html page from the template. Code: <a href="logset.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Log & Grate Set',Templates/'','..assets/menu/log_over.jpg'',1 For some reason it is adding the directory templates, and therefore does not find the image. Does anyone know how I can fix this? Thanks, braves07 Hi all, Graphic designer here hell bent on learning web design with a question probably asinine for all those viewing but vexing to me for the last week. I have a site beautifully designed (can be seen here as a static jpeg) and seemingly straight forward and basic but making it functional on the web as I designed is proving to be quite the arduous task. I have many questions concerning this project but I'll keep this thread focused on the code for positioning images on the navbar. I have the buttons (67px by 14px) and sidebar (36px by 594px) all measured out and have tried a few different semantics to accomplish this but all for not. The images always end up stacking in the top left corner. HTML Code: <body> <div id="butttons"> </div> <div id="nav"> <img src="images/layout/images/Side_nav.png"/> </div> <div id="butttons"> <div id="nav_Home"> <img src="images/layout/images/Home.png"/> <div id="nav_Portfolio"> <img src="images/layout/images/Portfolio.png"/> <div id="nav_Contact"> <img src="images/layout/images/Contact.png"/> </div> </body> And then this is the Refferenced style sheet HTML Code: #nav { position: absolute; top: 0px; left: 0px; } div.nav_side { background-image: url(images\layout\Side_nav.gif); background-repeat: no-repeat; background-position: top center; width: 36px; height: 594px; } #buttons { position: absolute; background-repeat: no-repeat; background-position: top center; top: 500px; left: 36px; } .nav_home { background-image: url(images\layout\Home.gif); background-repeat: no-repeat; background-position: top center; position: absolute; top: 552; left: 35; width: 67px; height: 14px; } .nav_Portfolio { background-image: url(images\layout\Portfolio.gif); background-repeat: no-repeat; background-position: top center; position: absolute; top: 566; left: 35 width: 67px; height: 14px; } .nav_Contact { background-image: url(images\layout\contact.gif); background-repeat: no-repeat; background-position: top center; style="position: absolute; top: 580; left: 35;"/> width: 67px; height: 14px; } I literally just started learning Html /CSS / Java a month ago; spare no details! ANY help with ANY (text formatting, background gradient that adjusts relative to a screen size, rollovers on the nav etc...) part of putting this site together will be more appreciated then most can fathom. I'd be willing to exchange some graphic work if any of you stuck this out to the end with me. Hi, as you can tell by the title, I'm having trouble placing 2 image links next to each other on Myspace. If i can post the links and someone can help me, I'd be very grateful. (I'm not trying to promote my band or anything here, no one has to listen) I am wanting this Facebook image: http://s86.photobucket.com/albums/k1...logo_black.jpg linked to our facebook page: http://www.facebook.com/pages/Teenag...19513834790706 And this Twitter logo http://s86.photobucket.com/albums/k1...0_allblack.png linked to our Twitter page: http://twitter.com/#!/teenagemaryuk I have already managed to get the Twitter link on our Myspace (www.myspace.com/teenagemary) but I'm pulling my hair out trying to get them next to each other, I've even tried tables to no avail. Any help would be extremely appreciated! please, check http://members.dodo.com.au/~rouslan/...ite/index.html I need to know how to get rid off strange effect down the bottom and how do I make text and image aligned on the same "line", "level" e.g. image image text text text text text text text text image image text text text text text text text text image image text text text text text text text text image image text text text text text text text text For some reason, in IE8 (or all IE's, for all I know) there is a mysterious little purple line at the bottom left corner of all of my navigation button images, excluding the first one. In FF it works just fine..Chrome, Safari and Opera I don't have, so for all I know it could just be FF that's displaying it correctly. Here's my code: HTML HTML Code: <a href="index.html" style="margin:0"> <img src="images/nav_home.png" alt="HOME" onmouseover="this.src='images/nav_home_hover.png';" onmouseout="this.src='images/nav_home.png';" /> </a> <a href="the-author.html"> <img src="images/nav_author.png" alt="THE AUTHOR" onmouseover="this.src='images/nav_author_hover.png';" onmouseout="this.src='images/nav_author.png';" /> </a> <a href="contact.html"> <img src="images/nav_contact.png" alt="CONTACT US" onmouseover="this.src='images/nav_contact_hover.png';" onmouseout="this.src='images/nav_contact.png';" /> </a> CSS Code: img { border: 0px; margin-left: 1.75em; } I also attached a screenshot. Thanks, C-Style I am having trouble getting an image to line up in a cell so that the text aligns left and the image directly to the right of it to match the other cells. http://smartvending.com/testindex.html Can anyone see what is wrong with the code that is preventing the Coin Counters & Sorters gray box from allowing anything to align closer to the right side of the box matching the other cells? Any help is greatly appreciated! Thanks I'm trying to position text, links and pictures to follow one after the other, but it doesn't work. I want to see "Homepage" on the left corner of my webpage "Next" on the right corner of my webpage Unfortunately this command doesn't work properly. <div style="text-align:left;solid 2px #ff0000;"><a href="F:\Webcomic\Website Folder\NWvisuals-Index.html"> Home</a> <p align=right><a href="F:\Webcomic\TheEyeoftheWorld3.html">Next</a></div></p> It makes the "Next" go down a line, instead of being in the same line of the "Homepage". Also, on that vein, is there any way I can align images and text on the same line without using spaces*? As in: <p align="left">Hello</p> <p align="center">Hello</p> <p align="right">Hello</p> But they all should stay on the same line. Any guides, or even links to tutorial about my issue would be appreciated. I've been trying to google for a while, it's becoming frustrating. *I think the problem with spaces is that people with different resolution would see the text in different places than I want them to see. I'm trying to make an image appear/change in response to a rollover, but the image is not in the same table as the rollover. I'm trying to redesign the header of my website, and have come up with this draft: bottleweb.org/test I want an image to appear in between the "BOTTLEWEB.ORG" text and the buttons. If for example I move my mouse over the 'forum' button, I want an image corresponding to 'forum' to appear in between the buttons and the "BOTTLEWEB.ORG" test. Is this possible? Hi, I'm trying to have my text link to shift to the right about a pixel or 2 when I roll over it, any help would be greatly appreciated. Tom. Okay, so I've been seeing these sites with text that you rollover and a box with more info appears. How do you do this? JS? CSS? It's hard to explain, so I'll look for an example. Note to mods: I don't know where this would go, so feel free to move it. EDIT: I know you can use the title attribute, but that's not the same thing Thanks. Hey - I'm in the middle of making a website for our family villa, and was wanting to put on a picture of the floor plan. I thought it'd be a good idea if when you mouse over a room, a big picture of the room shows up - kind of like an image map, only you wouldn't on the room, and the photo would show up over the floor plan (if that makes sense!) Can anyone tell me how to do this please? Thanks!! I'm not sure whether this would be html or CSS.. but does anybody know how to get rollover text to popup using html or CSS like I have circled in this screenshot?: http://i134.photobucket.com/albums/q...eenshot_03.jpg Any help is greatly appreciated. <TR> <TD ROWSPAN="1" COLSPAN="1" WIDTH="156" HEIGHT="156"> <A HREF="#" onMouseOver="playSound(0)""if(document.images) document.BACKGROUND2WHITE0.src='piece1.jpg';" onMouseOut="stopSound(0)""if(document.images) document.BACKGROUND2WHITE0.src='piece1.jpg';"> This code was written to play a music file and change the image while the mouse hovers over it, and when the mouse is taken off, the music stops and the image reverts to its original picture. There is code before this which stores the music file. My problem: When i put the mouse over it, the music plays but the image doesn't change. I'm an amateur at HTML so someone please tell me, what am I doing wrong? I'm using the DOM rollover script, but I have no idea how to put text over it. Is it even possible? I'd appreciate any help. Thanks! I have already posted rollover threads, and my problem was solved. However, as I was building my online website, I realised that an end-user has to wait for music files to buffer and load before the sound actually plays. Basically, my rollover is this: Code: <TD ROWSPAN="1" COLSPAN="1" WIDTH="156" HEIGHT="156"> <a href="javascript:void(0);" onMouseOut="MM_swapImgRestore();stopSound(0);" onMouseOver="MM_swapImage('Image9','','musicplaying.gif',1);playSound(0);"><img src="piece1hit.jpg" name="Image9" width="156" height="156" border="0"></a></TD> - This plays music and an animation when a mouse is hovered over the original picture. My problem: when the mouse is hovered over the image, it takes about 30 seconds for the music to start playing as it is loading. To solve this, I want a line of text to appear when the mouse hovers over the image which lasts about 30 seconds, saying: "Please wait as music buffers." I have a line of code in mind: [code]<p class="time" begin="10" dur="5">text</p>[code] I also have all of the necessary coding to activate this code at the top of my page. But my question is: how do I put the timed writing, into the mouseover code? Any suggestions would be greatly appreciated. I know how to do a rollover evect with js but I was wondering if it is possible to do with css. Thanks for any help you can give me! Hello. Please could you look at this code for me and tell me what I have done wrong? I can't get it to change the picture on rollover. Thank you Code: <div style="background-color:#ff0099; height:25px;width:956px;float:left;""> <a href="http://www.google.co.uk" ONMOUSEOVER='rollover.src="http://farm5.static.flickr.com/4145/4983786279_f55ce0b9bb_m.jpg"' ONMOUSEOUT='rollover.src="http://farm5.static.flickr.com/4145/4983658949_91e6ffdc21_m.jpg"'> <img src="http://farm5.static.flickr.com/4145/4983658949_91e6ffdc21_m.jpg" NAME="rollover" width="236" height="25" border="0"> </a> <a href="http://www.google.co.uk" ONMOUSEOVER='rollover.src="http://farm5.static.flickr.com/4103/4984384100_9249a58aa3_m.jpg"' ONMOUSEOUT='rollover.src="http://farm5.static.flickr.com/4149/4984257696_f1fdb7cd27_m.jpg"'> <img src="http://farm5.static.flickr.com/4149/4984257696_f1fdb7cd27_m.jpg" NAME="rollover" width="236" height="25" border="0"> </a> <a href="http://www.google.co.uk" ONMOUSEOVER='rollover.src="http://farm5.static.flickr.com/4083/4984384182_ecc8cd023c_m.jpg"' ONMOUSEOUT='rollover.src="http://farm5.static.flickr.com/4112/4983659827_547410d1ed_m.jpg"' target="_blank"> <img src="http://farm5.static.flickr.com/4112/4983659827_547410d1ed_m.jpg" name="rollover" width="236" height="25" border="0"> </a> <a href="http://www.google.co.uk" ONMOUSEOVER='rollover.src="http://farm5.static.flickr.com/4144/4983786159_e7730fa193_m.jpg"' ONMOUSEOUT='rollover.src="http://farm5.static.flickr.com/4150/4983658139_5b6796a521_m.jpg"'> <img src="http://farm5.static.flickr.com/4150/4983658139_5b6796a521_m.jpg" NAME="rollover" width="236" height="25" border="0"> </a> </div> Is there a way to code a thumbnail so that onMouseover a larger version opens in a separate window and onMouseout the window automatically closes? I'm developing a web form for ordering display panels and there will be several catagories for the user to choose from each containing multiple selections. Something like this would aid the user by not forcing them to constantly close windows while making their choices. |