Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. CSS with input elements

CSS with input elements

Scheduled Pinned Locked Moved Web Development
questioncssarchitecture
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hesham Amin
    wrote on last edited by
    #1

    Hi.. I make a css file with the following lines: input { border-right: white thin solid; border-top: white thin solid; border-left: white thin solid; color: white; border-bottom: white thin solid; background-color: #0033ff; } I want to apply the style for only not all input controls.. How can I do it ?

    H 1 Reply Last reply
    0
    • H Hesham Amin

      Hi.. I make a css file with the following lines: input { border-right: white thin solid; border-top: white thin solid; border-left: white thin solid; color: white; border-bottom: white thin solid; background-color: #0033ff; } I want to apply the style for only not all input controls.. How can I do it ?

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      You can't. CSS is for elements, not attributes. What you can do instead is define an element class, either: input.button (limits class to input elements) or a stand-alone class like .button (can be used on any element). Then, specify the class attribute in your code: <input type=button class=button>.

      Reminiscent of my younger years...

      10 LOAD "SCISSORS" 20 RUN

      B 1 Reply Last reply
      0
      • H Heath Stewart

        You can't. CSS is for elements, not attributes. What you can do instead is define an element class, either: input.button (limits class to input elements) or a stand-alone class like .button (can be used on any element). Then, specify the class attribute in your code: <input type=button class=button>.

        Reminiscent of my younger years...

        10 LOAD "SCISSORS" 20 RUN

        B Offline
        B Offline
        Bjoern Graf
        wrote on last edited by
        #3

        In CSS2 one can match attributes (see Attribute selectors[^]). But IE doesn't support CSS2, one have to go with style classes :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups