Results 1 to 10 of 12
-
24th Mar 2012, 04:11 PM #1OPMember
Simple CSS highlight help
Code:<ul id="navigation"> <li class="active"><a href="/">Home</a></li> <li class="active"><a href="/myaccount">My Account</a></li> <li class="active"><a href="/editaccount">Edit Account</a></li> <li class="active"><a href="/logout">Logout</a></li> </ul>
Code:ul#navigation li { float: left; margin: 0 1px 0 0; padding: 8px 10px 8px 10px; font-size: 0.8em; background: #161616; /*background: #fff url(images/tab_background.gif) top left repeat-x;*/ font-family: "Verdana", sans-serif; } ul#navigation :hover { background: #376a00; } /*Navigation Text*/ ul#navigation li a { color: #FFF; text-decoration: none; } ul#navigation li a:hover { color: #fff; font-family: "Verdana", sans-serif; } ul#navigation li.active { border-bottom: 1px solid #000; background: #81CA2A; }
NewBiee Reviewed by NewBiee on . Simple CSS highlight help <ul id="navigation"> <li class="active"><a href="/">Home</a></li> <li class="active"><a href="/myaccount">My Account</a></li> <li class="active"><a href="/editaccount">Edit Account</a></li> <li class="active"><a href="/logout">Logout</a></li> </ul> This is my HTML, how do I highlight the current tab which is currently viewed on the browser? Rating: 5
-
24th Mar 2012, 04:14 PM #2ლ(ಠ益ಠლ)Website's:
extremecoderz.commodify
ul#navigation li.active
-
24th Mar 2012, 04:16 PM #3MemberWebsite's:
LulzCovers.com LulzTroll.comall links can't be in the same class
<li class="active">
make a new class as inactive and assign others to it..
let the inactive class colors be little dull to make a significant difference of active/inactive.
Code:<ul id="navigation"> <li class="active"><a href="/">Home</a></li> <li class="inactive"><a href="/myaccount">My Account</a></li> <li class="inactive"><a href="/editaccount">Edit Account</a></li> <li class="inactive"><a href="/logout">Logout</a></li> </ul>
Contact me for Traffic, SEO, WCDDL, Wordpress, IPB related Services or queries.
Template Designing, PSD to HTML, Wordpress
-
24th Mar 2012, 04:37 PM #4OPMember
-
24th Mar 2012, 07:00 PM #5Too busy :|Website's:
L337Fx.com BeastieBay.netWhat deAthbLisS said is right.
Add this CSS code in your .css file
Code:ul#navigation li.active1 { border-bottom: 1px solid #000; background: #304b0f; }
Example:
PHP Code:<ul id="navigation">
<li class="active"><a href="/">Home</a></li>
<li class="active1"><a href="/myaccount">My Account</a></li>
<li class="active"><a href="/editaccount">Edit Account</a></li>
<li class="active"><a href="/logout">Logout</a></li>
</ul>
If you need to edit the color, then change this background: #304b0f; (in the code I gave previously) as per your liking.
Goto http://www.color-hex.com/color/ for HTML Color Codes
-
24th Mar 2012, 07:22 PM #6MemberWebsite's:
mytinydick.com
-
25th Mar 2012, 04:04 AM #7Respected MemberWebsite's:
DL4Everything.com Soft2050.inActually, you can do so with a little bit of javascript to check all links and match ones that equals to the current path. And then set a special id attribute to them and add id style in your css file
You can add the javascript code to an existing .js file that is already in all pages.
As for the css, isn't it already in his code:
PHP Code:<ul id="navigation">
<li class="active"><a href="/">Home</a></li>
<li><a href="/myaccount">My Account</a></li>
<li><a href="/editaccount">Edit Account</a></li>
<li><a href="/logout">Logout</a></li>
</ul>
-
25th Mar 2012, 06:45 AM #8OPMember
Thank you sir for your reply, but I'll explain my problem a little bit more by this reply below.
This certainly is my problem. Lets say that my index.tbl (Because I'm using smartyphp) is:
So this is my Home.
PHP Code:{include file='header.tpl'}
<div id="content">
<center>
<img src="/images/construction.png">
</center>
</div>
{include file='footer.tpl'}
PHP Code:{include file='header.tpl'}
<div id="content">
<fieldset style="margin: 0 auto; width: 400px;"><legend>Profile</legend>
<div style="text-align: left;">
<label style="margin-left: 70px;">Username :</label>
<span>{$user_name}</span>
<hr style="width: 75%;" />
<label style="margin-left: 70px;">Fullname :</label>
<span>{$full_name}</span>
<hr style="width: 75%;" />
<label style="margin-left: 70px;">Email :</label>
<span>{$user_email}</span>
<hr style="width: 75%;" />
<label style="margin-left: 70px;">Premium Status :</label>
<span>{if $duration > 0}<span style="color: green; font-weight: bolder;">Active</span>{else}Trial{/if}</span>
<hr style="width: 75%;" />
<label style="margin-left: 70px;">Duration :</label>
<span>{$dur}</span>
<div style="margin-left: 70px;">Updates every 30 mins</div>
</div>
</fieldset>
</div>
{include file='footer.tpl'}
PHP Code:<ul id="navigation">
<li class="active"><a href="/">Home</a></li>
<li><a href="/myaccount">My Account</a></li>
<li><a href="/editaccount">Edit Account</a></li>
<li><a href="/logout">Logout</a></li>
</ul>
-
25th Mar 2012, 07:21 AM #9MemberWebsite's:
imdber.org justpaste.me^You can try do some php checking (maybe thru a variable) on which page you are currently in.
PHP Code:<li <?php echo $isHome?'class="active"':''; ?>><a href="/">Home</a></li>
<li <?php echo $isMyAccount?'class="active"':''; ?>><a href="/myaccount">My Account</a></li>
<li <?php echo $isEdit?'class="active"':''; ?>><a href="/editaccount">Edit Account</a></li>
<li <?php echo $isHome?'class="active"':''; ?>><a href="/logout">Logout</a></li>
-
25th Mar 2012, 07:32 AM #10Respected Developer
if you are using smarty (as u mentioned above) see answer here:
http://*******/uViQGBots Development | Web Development | Wordpress Customization | PSD Conversion
Life has many twists and turns in it, you have to take what you are given and use it for the best.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Highlight searched text plugin
By r00ts in forum WordpressReplies: 2Last Post: 9th Apr 2012, 07:10 PM -
[Hiring] Simple PHP Job
By Apathetic in forum Completed TransactionsReplies: 0Last Post: 14th Sep 2011, 02:08 AM -
[Hiring] $10 simple job :D
By viruz99 in forum Completed TransactionsReplies: 8Last Post: 28th Nov 2010, 07:22 AM -
Something Simple
By w00ty in forum Graphics AreaReplies: 0Last Post: 14th Jul 2010, 07:58 AM -
Its seems so simple ...
By S?nic in forum IP.BoardReplies: 8Last Post: 20th Sep 2009, 12:42 AM
themaCreator - create posts from...
Version 3.24 released. Open older version (or...