3 Replies - 1190 Views - Last Post: 17 March 2013 - 07:45 AM

#1 Bishvabis  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 27-February 13

Overide default css list-style?

Posted 06 March 2013 - 04:24 PM

on my websites template they have the menu pages linked right to the list-styles, and it is defaulted to none, so basically bullets are not visible, if i turn it on they add bullets to the menu pages. how can i overide that css and just apply bullets to one page?
Is This A Good Question/Topic? 0
  • +

Replies To: Overide default css list-style?

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3730
  • View blog
  • Posts: 6,017
  • Joined: 08-June 10

Re: Overide default css list-style?

Posted 06 March 2013 - 04:54 PM

Moved to the HTML/CSS forum. This is not a PHP related issue.

What you need to do is examine the structure of the pages and set the styles so that the menu styles override the global styles. The more specific a selector is, the higher precedence it has.

So, for example, say I have this HTML snippet in the body of a HTML page.
<div id="container">
    <ul id="menu">
        <li><a href="/">Home</a></li>
        <li><a href="/about/">About Us</a></li>
    </ul>
    <ul>
        <li>A text item that should have a point in front of it.</li>
        <li>And another one!</li>
    </ul>
</div>


If I simply do this, the points will be added or removed removed for both lists.
ul {
    list-style: none;
}


What I need to do is specifically set the style for the "#menu" list, to remove the points there.
ul {
    list-style: disc;
}
#menu {
    list-style: none;
}


Now the menu won't have discs in front of it, but all other <ul> elements will.
Was This Post Helpful? 0
  • +
  • -

#3 CynicalSolution  Icon User is offline

  • New D.I.C Head

Reputation: -3
  • View blog
  • Posts: 15
  • Joined: 17-March 13

Re: Overide default css list-style?

Posted 17 March 2013 - 06:36 AM

You should really learn Down the Line CSS for example


#menu ul{
/*Rules*/
}



Was This Post Helpful? -1
  • +
  • -

#4 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3730
  • View blog
  • Posts: 6,017
  • Joined: 08-June 10

Re: Overide default css list-style?

Posted 17 March 2013 - 07:45 AM

View PostCynicalSolution, on 17 March 2013 - 01:36 PM, said:

You should really learn Down the Line CSS for example


#menu ul{
/*Rules*/
}



I'm not sure exactly what you intend for that to mean. Could you explain this further?

Assuming that example is aimed at my previous example, then it wouldn't have any effect. You are targeting UL elements within the #menu element, and there are no such elements. If you wanted to target the UL element with the ID #menu (which would be over-specific, since IDs are/should be unique to one element per page) then you'd want to do ul#menu.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1