SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Location
    Campbeltown, Scotland
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    text-decoration in a select box

    Hi

    Does anyone know if its possible to put a text-decoration:line-through some text in a select box? It doesnt seem to work for me.

    I am listing different size combinations and I wanted to put a line through and change the text color to grey for items that are out of stock rather than just not list them. Or is there a better a way that anyone can think of?

    Thanks

    Asa Carter

  2. #2
    SitePoint Addict buildakicker's Avatar
    Join Date
    Jun 2005
    Location
    NorCal
    Posts
    378
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure:

    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <
    html xmlns="http://www.w3.org/1999/xhtml">
    <
    head>
    <
    meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <
    title>Untitled Document</title>
    <
    style>
    .
    select{

    }
    .
    opt1{
    text-decoration:line-through;
    }
    .
    opt2{
    font-size:14px;
    }
    .
    opt3{
    font-weight:bold;
    }
    </
    style>
    </
    head>

    <
    body>
    <
    select name="demo" class="select">
    <
    option>Make Selection</option>
    <
    option class="opt1">Demo1</option>
    <
    option class="opt2">Demo2</option>
    <
    option class="opt3">Demo3</option>
    </
    select>
    </
    body>
    </
    html
    SKILEASES.COM - FREE rental listings!
    WILDFIREBLOG.COM - Wildland Fire microblog!

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Location
    Campbeltown, Scotland
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Works for FF but not IE7. Why are the styles not applied in IE7?

    http://www.argyllnewmedia.co.uk/itrenz/test.php

  4. #4
    SitePoint Addict
    Join Date
    Feb 2006
    Posts
    247
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm glad it works, but I wouldn't go with that method. As a designer, I think it's important to believe that all your users are complete morons even if they aren't. By listings the items that are in stock with the items that aren't, you're still giving the users the option to select that item. It might be better to list the items that aren't in stock below the select list instead of listing them with the in stock items.
    I live in Madison. Where in the W1RLD do you live?

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Location
    Campbeltown, Scotland
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeh maybe your right.

    I was just giving the not stocked item an ID value of 0 so it couldn't be added to the basket but I guess listing them all togther may be confusing.


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
  •