SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Apr 2008
    Location
    India
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to control a second link in an li

    Hi all,

    I have a html code like this

    <ul class="news">
    <li><a href="#">link1</a><br />
    <a href="#">link2 </a></li>
    <li><a href="#">link1 </a><br />
    <a href="#">link2 </a></li>
    <li><a href="#">link1 </a><br />
    <a href="#">link2/a></li>
    </ul>

    and I want the two link in each li having two styles i.e. in two colors

    I controlled my links through a class like

    ul.news li a {
    font-family: Arial, Helvetica, Sans-serif;
    font-size: 12px;
    text-decoration: none;
    color: ff0000;
    }

    but all links are in same color, how can I control my second link in an li

    thanks all in advance

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,510
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Can't you assign a different class to each of the 2 links?

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2008
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    class seems to be a good idea. You can also add span tag, that will have this same effect.Try it.
    <ul class="news">
    <li><a href="#"><span>link1</span></a><br />
    ul.news li a span{

  4. #4
    SitePoint Member
    Join Date
    Apr 2008
    Location
    India
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank u for suggestions,

    Yes, we assign two classes for two links when we design html, but I have this problem in a joomla site, it is already coded, just I want to do is control only it with css without edit the html part, is it possible with css to apply a second link in an li a different style.

    actual code is

    <ul class="recentblog">
    <li><a href="http://202.65.155.11:8080/milaarts/index.php?option=com_mojo&amp;Itemid=42&amp;p=3" title="Testing Blog function ">Testing Blog function </a><br />
    <a style="color: white; font-size : 9px; line-height : 9px;">Testing limitations of blog on homepage. <br /></a></li>

    <li><a href="http://202.65.155.11:8080/milaarts/index.php?option=com_mojo&amp;Itemid=42&amp;p=2" title="test 2 ">test 2 </a><br />
    <a style="color: white; font-size : 9px; line-height : 9px;">test 2 blog description <br /></a></li>
    <li><a href="http://202.65.155.11:8080/milaarts/index.php?option=com_mojo&amp;Itemid=42&amp;p=1" title="Test Blog">Test Blog</a><br />
    <a style="color: white; font-size : 9px; line-height : 9px;">Mila means 'culture' in Swahili, a language spoken mostly on the East Coast of Africa. Mila is a pat...<br /></a></li></ul>

    give some suggestion to do this please


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •