SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Oct 2006
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    noob: what goes into css

    If you have the following in html file, what would you put in css file?

    PHP Code:
    <input type="text" name="username" id="username" size="15" tabindex="1" /> 
    just put this stuff in css:
    div#username {size=15; tabindex=1}

    And in html file just declare:
    <input type="text" name="username" id="username" />

    and when browser calls the html, if would make it as:
    PHP Code:
    <input type="text" name="username" id="username" size="15" tabindex="1" /> 
    Am I right?

  2. #2
    SitePoint Member
    Join Date
    May 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    size and tabindex are attributes of the input tag so are fine as they are.

    css isn't required in this instance.

  3. #3
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not only that, but they're not valid CSS properties either.

  4. #4
    SitePoint Wizard bronze trophy DaveWoods's Avatar
    Join Date
    Dec 2004
    Location
    Derbyshire - UK
    Posts
    2,651
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Although I'd personally scrap the size from your HTML and apply the width within the stylesheet

    #username {
    width: 20em;
    }

    Or something like that.

    Also, I would only use tabindex if the formfields on your page don't follow a logical tabbing order. Usually they do unless you've done something odd so in most cases you can safely omit that from your HTML as well.


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
  •