Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter bootstrap form fields too small

I know this topic "sounds" a lot like others that are out there but I've looked through all the existing threads (well "most" anyway) and I still have a problem I could use help on ...

The problem is not too dissimilar to what others have described:

  • Certain FORM elements do not display their full vertical height
  • Most notable amongst these is the INPUT type looks sort of anaemic in size when sitting next to a button or "add-on" class
  • More recently I noticed an even more severe problem ... radio buttons become "radio dots" as they are so small they're hardly visible.

Now a LOT of people solved their problem by making sure they specified the DOCTYPE correctly at the top of their HTML document. I too found that this simple adjustment did the trick on my static HTML mock-up. Sadly when I switched to Wordpress the problem reappeared and yet I am very definitely putting the HTML 5 DOCTYPE signature at the very top of the output (I've checked this several times with "view source" as I thought maybe I'd lost my mind).

I've included a quick snapshot of the screen in case this helps shed any light on this. You can find it here: http://www.flickr.com/photos/14261777@N00/6957941282/. Note the tiny little dots at the bottom that are supposed to be radio buttons. More obvious are the INPUT fields that are not tall enough. Oh, and also for completeness, here's a screenshot of how my HTML source starts: http://www.flickr.com/photos/14261777@N00/6957952802/.

I'd love to hear from anyone who has a theory on WHY this could be happening and any workarounds that might exist (even if the source of the solution is unknown). I have tried imposing CSS attributes like line-height, height, min-height, etc. and a few others with zero effect.

like image 585
ken Avatar asked Apr 22 '12 23:04

ken


1 Answers

It looks like you have two problems. The input type=text problem and the radio button problem. Without seeing your code, it appears as though your textbox problem is related to DOCTYPE and your radio button problem is related to overriding CSS styles (can confirm if you post the inspector output for the radio buttons).

If your variables are showing as the correct values (eg. 18px height), which they are, then it is most definitely a DOCTYPE issue.

From this article on A List Apart:

You’ve done all the right stuff, but your site doesn’t look or work as it should in the latest browsers.

You’ve written valid XHTML and CSS. You’ve used the W3C standard Document Object Model (DOM) to manipulate dynamic page elements. Yet, in browsers designed to support these very standards, your site is failing. A faulty DOCTYPE is likely to blame.

This little article will provide you with DOCTYPEs that work, and explain the practical, real–world effect of these seemingly abstract tags.

Here's the recommended list of DOCTYPEs as per W3C:

http://www.w3.org/QA/2002/04/valid-dtd-list.html

like image 154
Terry Avatar answered Nov 16 '22 00:11

Terry