The structure of the TEXTAREA tag in CSS?

Discussion in 'HTML & Website Design' started by webtracker, Sep 24, 2006.

  1. #1
    What would be the CSS equivalent of this:


    <textarea class="someclass" cols="50" rows="2" onclick="this.focus();this.select()" readonly="readonly"></textarea>

    TEXTAREA{

    ?

    }



    Thanks
     
    webtracker, Sep 24, 2006 IP
  2. sketch

    sketch Well-Known Member

    Messages:
    898
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    148
    #2
    If you only want "someclass" to be applied to textareas, use

    textarea .someclass {
    code
    }

    Or if you want all textareas the same, simply apply it to the textarea like you show:

    textarea {
    code
    }
     
    sketch, Sep 24, 2006 IP
  3. bochgoch

    bochgoch Peon

    Messages:
    1,918
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #3
    cols="50" : HTML only can't set in css
    rows="2" : HTML only can't set in css
    onclick="this.focus();this.select()" : javascript NOT css
    readonly="readonly" : HTML only can't set in css

    ...basically, there is no css equivalent, these attributes cannot be influenced by css...css is about styles, these are not style considerations!

    bg
     
    bochgoch, Sep 24, 2006 IP
  4. x5386x

    x5386x Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Right. Possible CSS declarations for TEXTAREA are e.g. width, height, color, font-size, font-family etc.
     
    x5386x, Sep 25, 2006 IP
  5. Zipp425

    Zipp425 Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    hmm how about this...
    
    
    textarea.someclass{
    width:318px;
    height:35px;
    }
    
    Code (markup):
    cant do onclick, or readonly in CSS but im sure you knew that...
     
    Zipp425, Sep 26, 2006 IP