HTML - Set A Href Active?
Hi there,
I`ve been doing some programming in java and delphi, but now its time for me to try to learn some html/css, and later some php. Anyways, I`m making this test site, where the meny consists of 4 text elements, all containing a href: <a href="foto.html" target="myFrame" id="menu_items">foto</a>; I`m using an external .css file to controll the graphics of the site, and there I have edited the a:visited, hover, active... When I click on one of the menu items, the color changes, as when I hover too. But I would like the first element of my menu, home, to be active when the page loads. How can I do this? Hope you understand my question. Thanks in advance! EDIT: Ok, there has to be an easy answer to this one, so maybe I just didn't explain my problem good enough. =) When I enter the page for the first time (after writing the adress in the adressbar and clicking "GO"), the page loads, and shows the "home" section. My page contains the site-logo, menu, and an iframe which shows the pages (home, foto, contact, and so on) as html files included in the site. As a default, it loads with the home.html in the iframe, and therefor the text "home" in the menu wont change color to the active color, which I set in the external .css file. But when I click on either of the menu items now, after loading the page, it changes color and works fine. What I want, is to set the "home" text in the meny to the active color (or in the active state) when the page is loaded. Sorry for any bad english, doing my best. And again, thanks Similar TutorialsHi there, When running a website from my Hard Drive or CD, the Active X message pops up, saying: "To help protect your security, Internet Explorer has restricted this file from showing active content that could access your computer. Click here for options..." I know that if you disable the Windows security, this message goes away. I would like this message to not pop up regardless of your security settings... much like the format /y command in the good ol' DOS days. Is there a command that will force the computer to accept the page without user intervention? Thanks in advance! I Hello. I am having a tough time fixing this problem I'm having. I am creating a site using web expression 2. So far, everything is working fine, except for a couple of browser issues regarding active x controls. When I open the site on firefox, which from what I've read, doesn't use active x controls, everything loads fine. But, when I open the site on IE, the latest IE8, contents of my site aren't displayed properly due to blocked active x controls. How and what can I change in my code so that people viewing my site in IE8 can see it normally? Here is the source code and css: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="en-us" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Facpros</title> <link rel="stylesheet" type =" text/css" href="1css.css"/> </head> <body> <script type =" text/javascript"> //code for showing/hiding div dropdown comming soon </script> <div class="head" > <div id="Navigation" style="left: 313px; top: 244px" > <ul class="nav" > <li class="notparent"><a href="location"><span>Home</span></a></li> <li class="notparent"><a href="location"><span>About Us</span></a></li> <li class="notparent"><a href="location"><span>Contact Us</span></a></li> <li class="notparent"><a href="location"><span>Leadership</span></a></li> <li class="notparent" ><a href="location"><span>Events</span></a></li> <li class="notparent"><a href="location"><span>Our Members</span></a></li> <li class="notparent"><a href="location"><span>Inquiry</span></a></li> <li class="parent"><a href="location"><span>Language</span></a></li> </ul> </div> </div> <div class ="body" > </div> <div class ="foot"> </div> </body> </html> Code: body{ background-color:gray; background-image:url('backgroundimg.png'); } p{ font-family:Copperplate33bc; } ul.nav{ font-family:Copperplate33bc; list-style:none; padding: 0; margin: 0; font-size:14px; height:29px; } div.head{ top:0px; background-color:maroon; height: 275px; width: 1000px; margin-left:auto; margin-right:auto; } div.body{ background-color:teal; height:600px; width: 1000px; margin-left:auto; margin-right:auto; } div.foot{ background-color:black; height:100px; width: 1000px; margin-left:auto; margin-right:auto; } li.notparent{ } li.parent{ } a:link{ text-decoration:none;color:black; } a:hover{ color:white; } #Navigation{ width:723px;;position:relative; } #Navigation li { float: left; display: block; text-decoration: none; text-align: center; padding-left:5px; padding-right:5px; width:auto; height:29px; line-height:3em; } using IE7 this is fine but in IE6 not so much. we have a page where we have a javascript function which can sort columns when the user presses an html hyperlink. This is fine but in IE6, when you click on a link, it seems to also highlight the oher links as purple (visited) when this is not true. how can we stop it from doing this and what about "resetting" it back to the default blue color when the page is navigated to again? Thanks Reference: http://test2.tarashryniw.com I have the following the css code: HTML Code: .tab-text a:link { text-decoration: none; color: #000; } .tab-text a:visited { text-decoration: none; color: #000; } .tab-text a:active { text-decoration: none; color: #adcce8; } .tab-text a:hover { text-decoration: none; color: #000; } This code is for the links in the tabbed menubar. a:active should be a bluish color, and it's my understanding that if you're on the page for which that link is then a:active should apply. Well go to a few different pages, the link colors don't change. Why? Css document this code is in is css/default.css. Thanks for the help! when I preview my website a active x bar shows up and another thing is that my pictures are not showing. What can I do? Hello! I have a horizontal bar with links, when you hover on one of the links, it changes colour and adds a tiny background image. That's perfect.- BUT I want this bgimage and the color to remain on the ACTIVE link, so that the user can know what page he/she is on. This si my code: <div class="bar"> <div id="filters"> <ul> <li><a class="" href="#all" rel="all">Alla</a></li> <li><a class="" href="#webdesign" rel="webdesign">Webdesign</a></li> <li><a class="" rel="print" href="#print">Print</a></li> </ul> </div><!-- .filters --> </div><!-- .bar --> CSS /* - Portfolio bar - */ .bar { height: 32px; background: url(http://blankest.com/theme/images/portfoliobar_bg.png) repeat-x 0 0; position: relative; padding: 2px 135px 2px 0; margin-bottom: 45px; } .bar a.hire { display: block; position: absolute; right: 0; top: -5px; height: 43px; width: 137px; background: url(http://blankest.com/theme/images/hire.png) no-repeat 0 0; } .bar a.hi hover { background-position: 0 -44px; } .bar li { display: block; float: left; margin-right: 2px; } .bar li a { display: block; padding: 0 23px; font-weight: bold; color: #545454; font-size: 13px; line-height: 28px; } .bar li a.active, .bar li a:hover { color: #ffffff; background: url(http://blankest.com/theme/images/bar_active_li.png) repeat-x 0 0; } Is there any way to embed windows media video into html without using active-x. This would be for a computer without administrative priveledges (unable to download active-x components) to view video through an html interface. I can only think of using a direct link to the file, which would require the player to be used externally. I think any embedded call up of the player will need to use embed or object tags, which need active-x (as far as I can tell, and my testing has shown) Any light shone on this black math would be greatly appreciated-- Thanks, Tim Hi there, Not sure if this is HTML or CSS - I've got a <ul> menu that I've set up and it's changing nicely in colour when you mouseover (using a:hover etc.) I've seen a few menus though where if you click on home, it loads home and that option stays a different colour to show you what page you're currently on.. any ideas? Hi all, If you go to http://kvc.dk/CTC7/index.htm Press "ctc-info" in the top menu you goes to a page with an iframe and links on top. When you press these links i want the current link to stay active until you press on another link. I have tried this: http://forums.htmlhelp.com/index.php...ndpost&p=38645 But i cant get it to work. Heres the code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/> <title>CTC</title> <link rel="stylesheet" type="text/css" href="../stylesheet.css"/> </head> <body> <table border="0" width="950" cellspacing="0" cellpadding="0" height="500"> <tr> <td align="right" bgcolor="#000000" valign="top" style="padding-right: 10px; padding-top: 70px" background="../images/Frontimages/ombygning.jpg"> <table border="0" width="500" cellspacing="0" cellpadding="0" > <tr> <td style="border: 2px solid #FFFFFF"> <table border="0" width="100%" cellspacing="0" cellpadding="0" background="../images/hvidbg.png" > <tr> <td style="padding-left:5px; padding-right:5px; padding-top:5px; padding-bottom:14px"> <a target="menu" href="Text/CTCinfo/omctc.htm">Om CTC</a> | <a target="menu" href="Text/CTCinfo/ansatte.htm">Ansatte</a> | <a target="menu" href="Text/CTCinfo/samarbejdspartnere.htm">Samarbejdspartnere</a> | <a target="menu" href="Text/CTCinfo/dopingpolitik.htm">Dopingpolitik</a> | <a target="menu" href="Text/CTCinfo/job.htm">Job</a> | </font><a target="menu" href="Text/CTCinfo/downloads.htm"> Downloads</a></td> </tr> <tr> <td> <iframe name="menu" src="Text/CTCinfo/omctc.htm" width="500" height="329" frameborder="0" allowtransparency="true" background-color="transparent"></iframe> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </body> </html> Not too sure this is in the right forum part but as the title says, I have an activex powered video stream which I would like to be able to change the size of. I can change the size of the video by changing the values of the Height and Width in this code: <object classid="clsid:6F5A0B29-5C26-49A1-9462-4C9910F085F3" codebase="http://192.168.0.100/ICLAXPlayer.cab" width="720" height="576" align="absmiddle" id="ICLPlayer" events="True"> but that is in the code and not very accessible from the front end. So I thought about putting in a drop down menu which is shown he <form id="form1" name="form1" method="post" action=""> Zoom <select name="Zoom" id="Zoom"> <option value="1">50%</option> <option value="2">75%</option> <option value="3" selected="100%">100%</option> <option value="4">125%</option> <option value="5">150%</option> <option value="6">175%</option> <option value="7">200%</option> </select> </form> So my question is this: Firstly, how can I relate for example.. 50% to 720 x 576 and then when I have that value, how can I put it in the Width and height boxes so that the video is the correct size? Thanks in advance Ok its so easy & I dont know why its not working, but I want to make Models@PunkRockPrincess.com & Photographers@PunkRockPrincess.com both active links so that when you click them they open up as an email <p><h1 style="text-align: center;"><a href="http://www.myspace.com/punkrockprincess.com"><span style="color: ##00BFE1;">PunkRockPrincess.com on Myspace! </span></a></h1> <p style="text-align: center;"><span style="color: #cc99ff;"></span><img src="http://www.searchviews.com/wp-content/themes/clean-copy-full-3-column-1/images/myspace_logo.jpg" height="46" width="137" /></p> <h1 style="text-align: center;"><span style="color: #ffffff;">Models@PunkRockPrincess.com <br />Photographers@PunkRockPrincess.com</span></h1></p> So what do I change to this code? Hi all, Im building a mock-up website for a project im working on. Since the first version was built in PPT, i dont wanna build it from scratch - so the entire website is built from image maps. The problem im having is the need to add activeX controls to some of the pages. i.e., my page (reminder - just a big photo mapped) has a right-side menu, a left-side menu and the middle of the page (square shaped) is a form with radio buttons, drop down lists, checkboxes and a submit button. as far as i understand, its impossible to add such elements to an image map. so i was thinking about writing the form section in a separate HTML file, and "call" it from the original page (the map). I just have no idea how to do that. Can i define coordinates in which that image part will be replaced with another HTML file? Thanks for any ideas/help!! Hi Guys, If you use this page in firefox you get an active link, dotted border on the up/down arrows. Anyone know of a way to stop this happening with styles? Code: http://www.stompfrog.co.uk/rp/ I guess you could use a js function to take the focus off the link but would prefer a css solution if possible. Stomp I'm bulding a basic website navlist at the top of the screen. My problem is with the active link and how each is highlighted. I have not done this in many years so i'm sure i'm missing something simple as I just don't remember a lot of things. I believe the problem is with how my list is set up. HTML: <div id="navcontainer"> <ul id="navlist"> <li id="active"><a href="home.html" target="main" id="current">HOME</a></li> <li><a href="about.html" target="main">ABOUT</a></li> <li><a href="services.html" target="main">SERVICES</a></li> <li><a href="design.html" target="main">DESIGN</a></li> <li><a href="contact.html" target="main">CONTACT</a></li> </ul> </div> CSS: #navcontainer { margin: 100px; padding: 0; height: 30px; } #navcontainer ul { border: 0; margin: 0; padding: 0; list-style-type: none; text-align: center; } #navcontainer ul li { display: block; float: left; text-align: center; padding: 0; margin: 0; } #navcontainer ul li a { background: #CBC9C9; width: 108px; height: 28px; border-top: 1px solid #7A7A7A; border-left: 1px solid #7A7A7A; border-bottom: 1px solid #7A7A7A; border-right: 1px solid #7A7A7A; padding: 0; margin: 0 0 10px 0; color: #494949; text-decoration: none; display: block; text-align: center; font: normal 20px/28px "Lucida Grande", "Lucida Sans Unicode", Arial; } #navcontainer ul li a:hover { color: #CBC9C9; background: #989797; } #navcontainer a:active { background: #7A7A7A; color: #CBC9C9; border-top: 1px solid #7A7A7A; border-left: 1px solid #7A7A7A; border-bottom: 1px solid #7A7A7A; border-right: 1px solid #7A7A7A; } #navcontainer li#active a { background: #7A7A7A; border: 1px solid #CBC9C9; color: #9B9B9C; border-top: 1px solid #7A7A7A; border-left: 1px solid #7A7A7A; border-bottom: 1px solid #7A7A7A; border-right: 1px solid #7A7A7A; } I guess I don't know how to properly identify the active link. If you'll go to www.njcomplete.com, enter, you will see what I am talking about. The initial load looks right. However when I click on another link the page changes but the active link highlight isn't right. Any idea what I'm doing wrong? I'm trying to setup HREF (Hyperlinks) to go to UNC. The reason for this, is that I need to have users click a link on the page to install their printers, so any example of a UNC (that they could type into the run line) would be: \\PRINT-SERVER\PRINTER1 or \\Print-server\Printer2 But, when I type this in to my HREF statement, I get a permissions error when I try to click the link. However, if I copy that same link into the run line, it works. Can anyone help me here? Thanks very much in advance! Hello, I specified an if/else statement. Now, I would like to, in addition to "getting an element by Id", include an anchor (i.e., href="#span1"). below is what I have so far. where do I insert my reference to an anchor (i.e., href=...)? thanks! <SCRIPT language="JavaScript"> <!-- function getSet() { var r=Math.random(); if (r>0.5) {document.getElementById('set1').style.visibility='visible'; else {document.getElementById('set2').style.visibility='visible'; } //--> </SCRIPT> Im making a nav menu for my Wordpress page. I made it with PNG sprite and with some jquery hover effects. I deliberately made the menu with PNG sprites, because the menu is static, no new categories will be added to it so I figured I'll do it with png. What I want to do is to make the menu item stay in the hover state after the click - that way the user can see on what part of the website he currently is. Code: <ul id="navigation"> <li ><a class="aa" href="test1.html"></a></li> <li ><a class="bb" href="test2.html"></a></li> <li ><a class="cc" href="test3.html"></a></li> <li ><a class="dd" href="test4.html"></a></li> <li ><a class="ee" href="test5.html"></a></li> <li ><a class="ff" href="test6.html"></a></li> <li ><a class="gg" href="test7.html"></a></li> </ul> Code: #navigation li a { background-image:url(menu-a.png); display:block; } .aa { background-position: 0px 0; height: 38px; width: 108px; margin-left: 16px; } .bb { background-position: -108px 0; height: 38px; width: 110px; } .cc { background-position: -218px 0; height: 38px; width: 116px; } .dd { background-position: -334px 0; height: 38px; width: 158px;} .ee { background-position: -492px 0; height: 38px; width: 104px; } .ff { background-position: -595px 0; height: 38px; width: 141px;} .gg { background-position: -736px 0; height: 38px; width: 78px; } #navigation a .hover { background:url(menu-a.png) no-repeat; display: block; opacity: 0; position: relative; top: 0px; left: 0; height: 100%; width: 100%; } #navigation a.aa .hover { background-position:0px -38px; width:108px; height:38px; } #navigation a.bb .hover { background-position:-108px -38px; width:110px; height:38px; } #navigation a.cc .hover { background-position:-218px -38px; width:116px; height:38px; } #navigation a.dd .hover { background-position:-334px -38px; width:158px; height:38px; } #navigation a.ee .hover { background-position:-492px -38px; width:104px; height:38px; } #navigation a.ff .hover { background-position:-595px -38px; width:141px; height:38px; } #navigation a.gg .hover { background-position:-736px -38px; width:78px; height:38px; } This is as far as I've got. The menu works, hovers correctly etc. But how do I make the hover effect for "aa" stay active when the visitor lands on test1.html page, "bb" for test2.html etc.? Thanks! We all know that annoying popup notification that disables everything cool about a site. Being that im making this site that needs to be old folks friendly, and they tend to use IE a LOT. I dont want them to feel frightened by this popup. And just leave the site. I wanna disable the notification.. is there any way I can do it with some code? Or has IE messed with me yet again? ty o and for the ones that dont understand what im talking about: Quote: What is active content and why does Internet Explorer restrict it? Active content is interactive or animated content used on websites. It includes ActiveX controls and web browser add-ons, which are small programs that are used extensively on the Internet. Active content can make web browsing more enjoyable by providing toolbars, stock tickers, video, animated content, and more. Why does Internet Explorer restrict active content? Internet Explorer restricts this content because occasionally these programs can malfunction or give you content you don't want. In some cases, these programs can be used to collect information about you, damage information on your computer, install software without your consent, or allow someone else to control your computer remotely. Given these risks, you should allow active content only if you completely trust the publisher or the website it's coming from. How can I allow active content? If Internet Explorer restricts active content that you are sure you want to allow, click the gold Information bar that appears at the top of the webpage, and then click Allow blocked content. For more information, see Internet Explorer Information bar: frequently asked questions. Perhaps it's just me, but I recently noticed this and I'm curious as to how it works. I don't even know if this is the right forum for this though. Take a look at these two pictures and websites. http://www.slidedeck.com/examples/reddal http://www.friendgiftr.com/ If you notice in the picture and the actual website, the first example does not show a tiny dotted border around the link that you click. But on the second site, clicking on a link will have that link surrounded by the thin dotted border. At least that's how it is for me on the latest version of Firefox and Internet Explorer. Is this something browser based? Or what? Why the inconsistency? http://www.rrexecutivesuites.com/design_plans.htm This above link takes you to the website I'm working on. It also takes you to the page I'm having trouble with. You've got a list of thumbs in an iframe on the righthand side and an enlarged view of the thumb on the lefthand side. You click on one of the thumbs and its enlarged view appears on the lefthand side. There's something annoying about the thumbs though. When you click on one, it scrolls back up to the top. I'd prefer that nothing happens except that the enlarged view changes to match the thumb the user clicks on. Right now, I have href="#" in the a tag for each thumb, and this seems to bring it back to the top (its real functionality is specified in the onclick="..." attribute). I'd like to have nothing at all, but when I don't include a value for href, it ceases to be a link. Is there some value to assign to href that maintains it as a link yet keeps it from doing anything (except for changing the enlarged view) - something like a null value? |