I am testing some elements for use in a web page and when using text input boxes it displays correctly in Firefox but when I looked at it in IE the text boxes were unreadably small.
I have linked screeenshots to more clearly explain what I am talking about.
Any ideas why?
Text Boxes in IE
Text Boxes in Firefox
That's weird. I assume you just used:
<input type="text" name="test" value="" />
?
If so, it must have something to do with your CSS file because the HTML will never change.
Try opening your page in Firefox and use FireBug to see the layout properties of the textbox. I guess somewhere you set the font-size to something really small.
Often there are inconsistencies between FireFox, Chrome and (mostly) IE in the way they interpret CSS tags.
It could help if you'd post a link to your webpage so we could check your HTML/CSS code.
Related
I've been doing some work with Blazor and the Blazorise library. I've hit a difference in layout between FF and Chrome that is screwing up the look of my grids
I can replicate it on their demo site: https://bootstrapdemo.blazorise.com/tests/datagrid
If I..
head there and set the Edit Mode dropdown to Inline
hit edit on any row
Inspect the first element
Change the class .table td class vertical-align: top so that it's baseline instead
I end up with this in FF:
And this in Chrome:
The bottom of the text in Chrome is all aligned. In FF, the plain text "2" is low
You might notice that there's a slight bug in the grid HTML render, in that the row in edit mode is not contained in a <tr; Blazorise team are aware of this, but doesn't seem to be the cause though, as I've manually added all the <td into a <tr and I still find that Firefox renders plain text lower than text in some edit controls (but not others).
So, I'm curious to know if this is an FF bug, a Chrome bug (chrome rendering is what I'd consider correct), a difference in opinion between the two camps that is unlikely to be considered a bug, or if there's something I can do to my blazorise grids (or pass on to the blazorise team) i.e. some missing HTML that, if included, would make FF align the content well.
When rendering "non editable text" like the "2" Blazorise puts it in the <td directly, whereas editable things get a relevant <input. Date and text inputs render higher up, while plain text, checkboxes, comboboxes, bootstrap alerts and buttons are lower down:
Blazorise creator here. The issue is going to be fixed in the next release and is scheduled for July 18th.
When I have an input field with a size attribute, it seems to be wider in Firefox compared to Chromium.
The issue gets A LOT worse when a language such as zh-HK is set (either through the html lang attribute or the Content-Language header). In this case, the input seems to be at least twice as wide in Firefox.
What is the reason for this huge discrepancy?
Please check the snippet below in different browsers:
<html lang="zh-HK">
<img src="http://i.imgur.com/kQUUnVF.png"><br>
<input size="50">
This is what it looks like for me in Firefox:
And yes, I know I can set the width using CSS.
The specification does not set any standard layout for this property. If you inspect that element with both browser's developer tools, you will find there are different property settings for both. Neither browser is wrong or right.
Testing my application on different browser the styling of a check box doesn't seem to be easy or very nice..
On chrome you get a slight orange box round the checkbox.
But when setting things like background or border and running my application on my blackberry. It makes no difference.
My check box is simple like this
<label for="chk">Checkbox</label>
<input type="checkbox" id="chk"/>
How hard is it to bold the checkboxes label when the checkbox is in focus?
My aim is basically, normal check when not focus, some kind of effect that user knows when its focused e.g. Bold Label, Border anything?
This must work on chrome + blackberry web browser and web works...
Also confused why the check box styling is strange compared to everything else...
Thanks :)
Check these out:
http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/
http://cssdeck.com/item/321/css-checkbox-styles
In Firefox extra spacing is added around the text value (not just vertical space as would be the case from line-height, but horizontal as well).
Chrome, Opera (has a slightly different line-height issue), and even IE all render submit buttons without adding any extra space.
http://jsfiddle.net/jswartwood/aFCwj/
If you open firebug and hover over the <a> and <input> respectively, you can see that it is not padding, etc.
From the sound of the bug tracker it seems that Firefox puts a "block" inside these form elements?!?! If this is true, why? This makes visual button size very difficult to keep consistent.
After digging through the Firefox source code (layout/style/forms.css) I found ::-moz-focus-inner to be the shadow selector I needed.
I still disagree with mozilla's choice of forcing line-height, but that is another story; in the mean time I may be able to normalize all browsers by setting line-height: normal.
input::-moz-focus-inner {
padding: 0;
border: 0;
}
A working example: http://jsfiddle.net/jswartwood/aFCwj/14/
To answer your original question: I do not believe CSS can successfully style the input submit element perfectly consistent across all browsers.
Every browser renders these elements differently. Explorer's buttons are in keeping with Windows. Safari's buttons are in keeping with Mac styling. Firefox, Chrome, Opera, etc. are going to do their own thing.
When it's important enough for your design that the submit button look the same across all browsers, you would create a custom graphic and make that your button.
Simply replace your submit button code with the following...
<input type="image" src="myButtonImage.jpg" alt="" />
You can optionally use CSS Sprites or JavaScript to swap button images on hover, click, etc.
A button doesn't have to be a button. You can use any other element, like a in your example, or even better span. And bind it click event to submit your form.
Now I know this issue is over-talked about but I cannot seem to find a question that addresses this little gem directly so here goes...
In Opera and IE when a form has focus the default submit input gets some sort of highlight. Like outline is when you have tab focused onto an element.
However, unlike the tab one (dotted lines inside or around which to me is nice and user friendly and so WANT it for my users) this one has some bizarre designs...
Firefox has its own problems but at least you can customise it. It reserves the space for the "highlight"/"border" or whatever you want to call it which means that your input will be bulker than any other browser. - why can't it do what it does for the anchors and have the highlight around the blasted thing?
Opera is odd in itself (Opera 10) since it makes the outline "highlight" whatever black. Now this isn't an issue UNLESS YOU HAVE A BLACK BACKGROUND... and it replaces the original border which is just palmface worthy... what were they thinking.
IE is like Firefox but no known way to customise it..
Now for the question: Is there a way to set the bloody colour in Opera for this focus event (which would solve that issue) or to have it in firefox without having to bloat the design in every other browser or a way to make IE conform at all.
Many thanks in advance
I tried and tried but I don't think this is possible.
button:active{background-color:#f00;}
button:hover{background-color:#0f0;}
That should allow you to control the visual interaction of a button. To target a specific button provide an id value in your HTML on the button tag.
try doing
<input type='submit' autocomplete='off' style='outline:none;'/>
this worked for me in text fields - I'm not sure if it carries over to submit or button elements but it's worth a try.
Kinda hackish, but definitely works..
<input type='submit' onfocus="blur()" />