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. Browser incompatibility

Browser incompatibility

Scheduled Pinned Locked Moved Web Development
questionhtml
5 Posts 2 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.
  • T Offline
    T Offline
    tiwal
    wrote on last edited by
    #1

    Hello I know there are a lot of incompatibilties between browsers , but what I am axperiencing now seems quite paradoxical. I have a small web page with the following simple html in it : label {width:240px;background-color:aqua} input:text {width:70px}

    Stato servizio
    Messaggio di benvenuto singolo Tipo messaggio di benvenuto singolo

    I expect labels and inputs to appear exactly formatted in columns and having the same width ..... This effectively happens, but only in IE10...If I use Chrome (29) or Firefox (10) every label has the size of its contents,no matter what is specified in the tag ... only the background color seems to correctly follow the style directive. Is there a way to make browsers follow standard html, and to work around eventual incompatibilities?</x-turndown>

    Richard DeemingR 1 Reply Last reply
    0
    • T tiwal

      Hello I know there are a lot of incompatibilties between browsers , but what I am axperiencing now seems quite paradoxical. I have a small web page with the following simple html in it : label {width:240px;background-color:aqua} input:text {width:70px}

      Stato servizio
      Messaggio di benvenuto singolo Tipo messaggio di benvenuto singolo

      I expect labels and inputs to appear exactly formatted in columns and having the same width ..... This effectively happens, but only in IE10...If I use Chrome (29) or Firefox (10) every label has the size of its contents,no matter what is specified in the tag ... only the background color seems to correctly follow the style directive. Is there a way to make browsers follow standard html, and to work around eventual incompatibilities?</x-turndown>

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      There are two problems with your styles:

      1. By default, a <label> is an inline element, and width doesn't apply to inline elements;
      2. input:text is a jQuery selector, not a CSS selector;

      Try:

      label
      {
      width:240px;
      display: inline-block;
      background-color:aqua
      }
      input[type=text]
      {
      width:70px
      }

      Example: http://jsfiddle.net/tJFUK/[^]


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      T 1 Reply Last reply
      0
      • Richard DeemingR Richard Deeming

        There are two problems with your styles:

        1. By default, a <label> is an inline element, and width doesn't apply to inline elements;
        2. input:text is a jQuery selector, not a CSS selector;

        Try:

        label
        {
        width:240px;
        display: inline-block;
        background-color:aqua
        }
        input[type=text]
        {
        width:70px
        }

        Example: http://jsfiddle.net/tJFUK/[^]


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        T Offline
        T Offline
        tiwal
        wrote on last edited by
        #3

        Ok thank you, I followed your suggestion and had a big improvement, even though there are still differences since the input object seems to be much smaller in size on Chrome and Firefox than on IE .... is it possible to fix this problem too ?

        Richard DeemingR 1 Reply Last reply
        0
        • T tiwal

          Ok thank you, I followed your suggestion and had a big improvement, even though there are still differences since the input object seems to be much smaller in size on Chrome and Firefox than on IE .... is it possible to fix this problem too ?

          Richard DeemingR Offline
          Richard DeemingR Offline
          Richard Deeming
          wrote on last edited by
          #4

          There's a lot of differences between the default rendering in different browsers. You'll need a browser normalization stylesheet[^] to get consistent rendering.


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

          T 1 Reply Last reply
          0
          • Richard DeemingR Richard Deeming

            There's a lot of differences between the default rendering in different browsers. You'll need a browser normalization stylesheet[^] to get consistent rendering.


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            T Offline
            T Offline
            tiwal
            wrote on last edited by
            #5

            ok thanks for the support Have a nice day

            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