<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1038686" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1038686</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/active-link-background#comment-1220459</link>
    <description> &lt;p&gt;Is there no way javascript can look at the current URL and match it to a link in the menu bar changing the style of that link? &lt;/p&gt;
&lt;p&gt;Maybe a little complicated, just that im using a CMS and have no idea where the PHP is that generates the HTML.&lt;/p&gt;
&lt;p&gt;Maybe parse the innerHTML of the specific
&lt;ul&gt;&lt;/ul&gt;
&lt;/p&gt;&lt;p&gt; then parse the
&lt;li&gt;&lt;/li&gt;
&lt;/p&gt;&lt;p&gt; and then parse the &lt;a&gt;&lt;/a&gt; looking for the URL??&lt;/p&gt;
 </description>
     <pubDate>Wed, 13 Jun 2007 10:06:59 +0000</pubDate>
 <dc:creator>benf</dc:creator>
 <guid isPermaLink="false">comment 1220459 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/active-link-background#comment-1220412</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: How can i make the background change on a link when you are on that actual page?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Umm. I thought that was in the solution I offered... ?&lt;/p&gt;
&lt;p&gt;Cordially, David.&lt;br /&gt;
--&lt;/p&gt;
 </description>
     <pubDate>Wed, 13 Jun 2007 00:12:41 +0000</pubDate>
 <dc:creator>webwiz</dc:creator>
 <guid isPermaLink="false">comment 1220412 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/active-link-background#comment-1220395</link>
    <description> &lt;p&gt;I believe you&#039;re asking how to assign CSS properties when a link is the current page. Something like the current page&#039;s hyperlink in the menu being bright red, while the rest are black. That sort of thing, right?&lt;/p&gt;
&lt;p&gt;As far as I know, the only way to do that is with scripting. The last time I did something like that, I had to use PHP. I created a class for the link that was the current page, then used PHP to determine which of the links used that class.&lt;/p&gt;
&lt;p&gt;It might look something like this...&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;li&amp;gt;&amp;lt;a &lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;ereg&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;index.php&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;PHP_SELF&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]))&lt;br /&gt;{&lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;class=&quot;currentpage&quot; &#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;href=&amp;quot;index.php&amp;quot;&amp;gt;Main&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Tue, 12 Jun 2007 13:17:10 +0000</pubDate>
 <dc:creator>timjpriebe</dc:creator>
 <guid isPermaLink="false">comment 1220395 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/active-link-background#comment-1220374</link>
    <description> &lt;p&gt;You can assign background properties for the link, visited and hover, that way, when you&#039;re on the page the background is retained whether the link is clicked or not... you can assign a separate BG for the hover if you like so when your mouse is over the link, the BG changes colours...&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;/*retains same link and bg color for active, regular, visited */&lt;br /&gt;a:link, a:active, a:visited {&lt;br /&gt;color: #FF0000;&lt;br /&gt;background: #000000;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/* assigns different bg and text color for hover */&lt;br /&gt;a:hover {&lt;br /&gt;color: #00FF00;&lt;br /&gt;background: #c00000;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;or you can simply use a wrapper div and assign a background to the wrapper that holds your links...&lt;/p&gt;
 </description>
     <pubDate>Tue, 12 Jun 2007 01:30:02 +0000</pubDate>
 <dc:creator>demonhale</dc:creator>
 <guid isPermaLink="false">comment 1220374 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/active-link-background#comment-1220368</link>
    <description> &lt;p&gt;What im trying to say is, a:active only works when you actually hold down the mouse key on the link (it is active) not when the link you press and are on that page. For example, you click on home.html (the actual link, a tag) and hold it down, the background will change, becuase it is active. However when you are actually on home.html the background will not show??? &lt;/p&gt;
&lt;p&gt;How can i make the background change on a link when you are on that actual page?&lt;/p&gt;
 </description>
     <pubDate>Mon, 11 Jun 2007 23:46:49 +0000</pubDate>
 <dc:creator>benf</dc:creator>
 <guid isPermaLink="false">comment 1220368 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/active-link-background#comment-1220330</link>
    <description> &lt;p&gt;I&#039;m not exactly sure what you mean:&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: Im trying to figure out how i can set a background image for a link when you are on the current page???&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Do you want to add a background image just to a link when it&#039;s a link to the current page, and not otherwise?&lt;/p&gt;
&lt;p&gt;For that, you could use a special class, say &#039;class=&quot;here&quot;;&#039; and style a.here with the background image you want to use. Another way of styling a site navigation, where, say, you are including the same code for the navigation on every page, you could do something like this:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;HTML&lt;/strong&gt;&lt;/p&gt;
&lt;ul id=&quot;sitenav&quot;&gt;
&lt;li class=&quot;homelink&quot;&gt;&lt;a href=&quot;index.htm&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;aboutlink&quot;&gt;&lt;a href=&quot;about.htm&quot;&gt;About&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;contactlink&quot;&gt;&lt;a href=&quot;contact.php&quot;&gt;Contact&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;CSS&lt;/strong&gt;&lt;br /&gt;
#sitenav a {background: #fff none; ...}&lt;br /&gt;
.home .homelink a {background-image: url(images/here-bg.png);}&lt;br /&gt;
.about .aboutlink a {background-image: url(images/here-bg.png);}&lt;br /&gt;
.contact .contactlink a {background-image: url(images/here-bg.png);}&lt;/p&gt;
&lt;p&gt;But this may be totally inappropriate. Can you give us a page to look at, and a description of how you want it to work?&lt;/p&gt;
&lt;p&gt;Cordially, David&lt;br /&gt;
(whose sig keeps vanishing)&lt;/p&gt;
 </description>
     <pubDate>Mon, 11 Jun 2007 05:23:51 +0000</pubDate>
 <dc:creator>webwiz</dc:creator>
 <guid isPermaLink="false">comment 1220330 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/active-link-background#comment-1220318</link>
    <description> &lt;p&gt;a:active is &quot;active&quot; when you&#039;re on that page *but* you have to make sure that a:active comes after a:hover&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.w3schools.com/css/css_pseudo_classes.asp&quot; class=&quot;bb-url&quot;&gt;http://www.w3schools.com/css/css_pseudo_classes.asp&lt;/a&gt; &amp;lt;- More there&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: a:link {color: #FF0000}     /* unvisited link */&lt;br /&gt;
a:visited {color: #00FF00}  /* visited link */&lt;br /&gt;
a:hover {color: #FF00FF}   /* mouse over link */&lt;br /&gt;
a:active {background: blah}   /* selected link */&lt;/p&gt;&lt;/blockquote&gt;
 </description>
     <pubDate>Mon, 11 Jun 2007 01:14:19 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1220318 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
