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. Other Discussions
  3. The Weird and The Wonderful
  4. CSS fun: mysterious 10.4%

CSS fun: mysterious 10.4%

Scheduled Pinned Locked Moved The Weird and The Wonderful
javascriptcssasp-netcom
6 Posts 4 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.
  • D Offline
    D Offline
    dan sh
    wrote on last edited by
    #1

    We are using Kendo UI components for an MVC application. Kendo's CSS has textbox width set as 12.4em. I want it to be 100%. So, in jQuery, I was setting it to 100%. But when the control is rendered, in the source I see it to be 110.4%. After just looking at the screen for sometime (didn't knew what to do), I asked my colleague for help. And we both were confused. We then created a 100px wide div and added a textbox to it. Then, same jQuery function was called to change the width to 100% instead of default 12.4em. It still showed up as 110.4%. Time not being on my side, I changed width in jQuery function to 89.6% and then it rendered as 100%. We are still looking for a good detective to help solve the mysterious 10.4%.

    "It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]

    Richard DeemingR J 2 Replies Last reply
    0
    • D dan sh

      We are using Kendo UI components for an MVC application. Kendo's CSS has textbox width set as 12.4em. I want it to be 100%. So, in jQuery, I was setting it to 100%. But when the control is rendered, in the source I see it to be 110.4%. After just looking at the screen for sometime (didn't knew what to do), I asked my colleague for help. And we both were confused. We then created a 100px wide div and added a textbox to it. Then, same jQuery function was called to change the width to 100% instead of default 12.4em. It still showed up as 110.4%. Time not being on my side, I changed width in jQuery function to 89.6% and then it rendered as 100%. We are still looking for a good detective to help solve the mysterious 10.4%.

      "It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]

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

      The first thing I'd check would be the box-sizing: box-sizing - CSS | MDN[^] Box Sizing | CSS-Tricks[^] The default is content-box, which means any padding and borders are added to the specified width. If you change it to border-box, the width includes the padding and borders, which makes it much easier to reason about the layout.

      html {
      box-sizing: border-box;
      }
      *, *:before, *:after {
      box-sizing: inherit;
      }


      "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

      D T 2 Replies Last reply
      0
      • D dan sh

        We are using Kendo UI components for an MVC application. Kendo's CSS has textbox width set as 12.4em. I want it to be 100%. So, in jQuery, I was setting it to 100%. But when the control is rendered, in the source I see it to be 110.4%. After just looking at the screen for sometime (didn't knew what to do), I asked my colleague for help. And we both were confused. We then created a 100px wide div and added a textbox to it. Then, same jQuery function was called to change the width to 100% instead of default 12.4em. It still showed up as 110.4%. Time not being on my side, I changed width in jQuery function to 89.6% and then it rendered as 100%. We are still looking for a good detective to help solve the mysterious 10.4%.

        "It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]

        J Offline
        J Offline
        Jon McKee
        wrote on last edited by
        #3

        Haven't used Kendo before but I've had issues with em and Bootstrap before because it's cumulative which is why I always use rem now if I can.

        D 1 Reply Last reply
        0
        • Richard DeemingR Richard Deeming

          The first thing I'd check would be the box-sizing: box-sizing - CSS | MDN[^] Box Sizing | CSS-Tricks[^] The default is content-box, which means any padding and borders are added to the specified width. If you change it to border-box, the width includes the padding and borders, which makes it much easier to reason about the layout.

          html {
          box-sizing: border-box;
          }
          *, *:before, *:after {
          box-sizing: inherit;
          }


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

          D Offline
          D Offline
          dan sh
          wrote on last edited by
          #4

          Perfect! That's what it was. Please share your bank account details for payment. :)

          "It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]

          1 Reply Last reply
          0
          • J Jon McKee

            Haven't used Kendo before but I've had issues with em and Bootstrap before because it's cumulative which is why I always use rem now if I can.

            D Offline
            D Offline
            dan sh
            wrote on last edited by
            #5

            Kendo loves em because ...KLM....

            "It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]

            1 Reply Last reply
            0
            • Richard DeemingR Richard Deeming

              The first thing I'd check would be the box-sizing: box-sizing - CSS | MDN[^] Box Sizing | CSS-Tricks[^] The default is content-box, which means any padding and borders are added to the specified width. If you change it to border-box, the width includes the padding and borders, which makes it much easier to reason about the layout.

              html {
              box-sizing: border-box;
              }
              *, *:before, *:after {
              box-sizing: inherit;
              }


              "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
              TheGreatAndPowerfulOz
              wrote on last edited by
              #6

              Nicely done.

              #SupportHeForShe Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun

              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