SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Nov 2007
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    remove duplicate content using css?

    Hi,

    I have some HTML which is displaying 2 selects, for example:

    PHP Code:
    <option value="select">Select Option</option>
    <
    option value="select">Select Option</option
    I don't have access to the actual HTML so I was wondering if its possible to remove one by using CSS?

    Thanks!

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,217
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    You can't remove anything with CSS, but I also don't think you can hide an option element with CSS (at least, I tried and failed). Can you use JS?

  3. #3
    SitePoint Zealot
    Join Date
    Nov 2007
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply. I was thinking of using display: none to remove/hide it, but wondered if I can use a parent selector or nth-of-type to get around it?

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,217
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by ebsolutions View Post
    I was thinking of using display: none to remove/hide it, but wondered if I can use a parent selector or nth-of-type to get around it?
    I tried that but couldn't get it to work, which is why I suspect JS is needed here.

  5. #5
    SitePoint Member
    Join Date
    Mar 2014
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can do it with JS ( jQuery(".classname").hide(); )but you need to append classes to your html.

    This might help and point you in the right direction.

    http://stackoverflow.com/questions/5...tion-in-select

    I have to ask. Why dont you have access to edit the php, html directly?


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
  •