Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    May 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    turn off the bullets in a <ul> inside a <p>

    Hi all

    i would like to turn of the bullets only if they are inside a <p>.

    I tried to do like this,
    P UL {list-style: none;} and it does not work.

    if i use a DIV instead of <p> and use DIV UL {list-style: none;} then it works.

    Could someone please help.

    thanks

    Raj

  • #2
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Hmm. From a semantic point of view, why would you have a <ul> (unordered list) inside of a <p> (paragraph)?

  • #3
    New to the CF scene
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Could always make a new UL class for those only within <p> tags.

    code inside the CSS would be:
    ul.whatever
    {
    ~~~
    }

    inside your html:

    <p>
    <ul class="whatever">
    ~~~~

  • #4
    New to the CF scene
    Join Date
    May 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    turn off the bullets in a <ul> inside a <p>

    Carl, I didn't know why any one would use a list inside paragraph but i was asked a question how would you solve it, and was wondering if there was a way to solve it.

  • #5
    Senior Coder JamieR's Avatar
    Join Date
    Oct 2004
    Location
    United Kingdom
    Posts
    3,161
    Thanks
    0
    Thanked 5 Times in 5 Posts
    I don't think you can use a list inside a paragraph - the validator will throw out a error I think..

  • #6
    Regular Coder
    Join Date
    Jul 2002
    Posts
    301
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Have you tried targeting the li or ol tags insted? Also try using lowercase in your CSS.

    p ul li {
    list-style: none;
    }

    And yes I think it won't work because it is invalid code (going from memory). I think you would be better off using a div as suggested. as such you could try:

    div ul {
    list-style: none;
    }
    or
    div ul li {
    list-style: none;
    }

    if you still get problems.

  • #7
    Senior Coder
    Join Date
    Feb 2003
    Location
    Ontario, Canada
    Posts
    1,223
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can't have a ul inside a paragraph. That's why your selector isn't working. Paragraphs can only contain inline elements, and <ul> is block-level.


  •  

    Posting Permissions

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