In my GWT application I have a button panel, implemented as HorizontalPanel containing Button widgets wrapped within <g:cell> elements.
<g:HorizontalPanel styleName="{style.horizontalPanel}">
<g:cell>
<g:Button ui:field="selectButton" title="{constants.buttonLabel}"
text="{constants.actionLabelSelect}" />
</g:cell>
...
</g:HorizontalPanel>
The buttons have the following css:
.gwt-Button {
font-size: 13px;
color: #337BB1;
margin: 0px 10px;
padding: 5px 7px;
border: 1px solid #E3E3E3;
}
Button labels often have two words. Compared to all non-IE browsers, the button panel does not fit into the layout. Each button looks way too wide, a certain button is only shown partly. Moreover, even if I resize the view (Ctrl + "-"), this still is the case, as the whole panel containing the buttons is resized. The behavior of all FF and Chrome is: button labels are line-breaked if the panel does not fit into the browser window, and the buttons are much smaller by default, so that it cleary fits in standard browser size.
Why is IE behaving differently?
Another problem with debugging is that in GWT's superDevMode and devMode, the problem does not occur in IE, too.
How is this possible?
Browser version: IE8,
GWT version 2.5.1
Try with CSS min-width Property
.gwt-Button {
...
min-width: 135px;
}
you can try with CSS overflow Property also
overflow: visible;
Related
I am using Elementor page builder. I mention this because it allows css to be placed in the widget itself.
I have two versions of a div table, one for PC and Tablet and another for Mobile only. They are co-existing on the same page but have display options set in each section.
Two days ago I gave the mobile version an extra class name of "scroll-table" and applied this css snippet to it;
table.scroll-table {
display: block;
overflow-x: auto;
white-space: nowrap;
}
The table scrolled horizontally quite nicely on Firefox mobile browser and well enough on Chrome mobile browser (client viewed on this browser). It was a very long day so I called it quits.
Yesterday I added some more css to place a button where the signup links were (final right hand column). I did this by adding the class name "button" to the links, "btn" seemed to be pre-existing because it immediately shrunk the text. Then I added this css snippet in both widgets (Mobile and PC).
.button {
display: inline-block;
padding: 12px 24px;
border-radius: 6px;
border: 0;
font-weight: bold;
letter-spacing: 0.0625em;
text-transform: uppercase;
background: #F39C25;
color: #fff;
}
The result was that the buttons appeared, and correctly, however it stopped horizontal scrolling on the Firefox mobile browser, while the Chrome mobile browser scrolls the whole page horizontally. This behavior on Chrome mobile is acceptable to the client but I am not thrilled with it. The day before, when it was working on Firefox mobile it scrolled as a container complete with a scroll-bar underneath. Being tired (and a little under the weather) I assumed this is what the client was seeing as well.
Adding !important to the overflow-x: auto; has no effect so I removed it again.
I have no problem adding css to the style.css if that would help, and have a Child theme installed. However, in the Elementor FB group there has been much ado about "You don't need a child theme." and thought in this case the widgets would be a more appropriate place to place it.
Can anyone help?
I have form with inputs/selects and one button.
If Button is <button/> then I have problems with it size in FF browser (it's bigger than inputs).
If Button is <input/> then I have problems with button text (I can't set it to be in the middle of button for all browsers).
Here is example (with <button> and with <input>)
EXAMPLE
Hi use padding instead of height for the buttons:
.form-search input.search-input, .form-search select.search-input, form input.search-input, form select.search-input {
padding: 0 20px 0 20px;
margin: 3px 0;
}
This is a common problem which I had with different browsers. You can use jQuery to find out if the browser is FireFox, use the referring css, and if the browser is Chrome or Safari, use another css, to gain your requirements.
I'm on FF 43.0.3, Mac OS 10.9.3. FF is cutting of the native checkbox on the right. It's not a css problem on my part; I confirmed the cutting off in CodePen. I also viewed a couple of random sites with checkmarks, and I see the same. I made sure to reset my browser zoom to default, and the default font is Times at 16px. I also tried turning off hardware acceleration via Preferences as another site suggested. Didn't work. The only code I have in my CodePen example is <input type="checkbox">
Would love to hear any suggestions.
This happens because of styling issues, and appears differently on different browsers. So try fixing the styling of the checkbox element and it's parent element, add some or all of these styles:
#parent-element { /*Or Whatever The ID Of The Parent Element Is*/
line-height: 20px;
height: 20px;
display: block
}
#checkbox-element { /*Or Whatever The ID Of The Checkbox Element Is*/
display: block;
height: 20px
}
Try changing the styles of the elements with different values to suit your needs.
I have a float right div within a template that loads correctly on initial page load or hard refresh.
However, on state change (using ui-router) then returning (ie swapping templates out), div gets bumped down, by what looks like a div to its left with no float.
Have I applied CSS incorrectly somehow?
Screen shots attached of both scenarios. First image is initial load, second is the page (NG template) returned after leaving via link on page. Link is a template too. The only reason I mention NG is that I've tried to recreate in Plunker with conventional href links, and failed to get the error.
HTML
<div class="locate-change">
<input type="text" color="red" placeholder="ENTER LOCATION" class="input1" />
<a ng-click="locateme()" href="" class="locate2">LOCATE</a>
</div>
CSS
.locate-change {
float:right;
height: 35px;
padding-left: 10px;
width: 300px;
}
.input1 {
display:inline-block;
border: 1px solid red;
background: #000000;
text-transform: uppercase;
font-family:'DINLightRegular', Helvetica, Arial, sans-serif;
font-size: 1em;
margin: 0;
padding: 4px;
outline: none;
width:160px;
}
.locate2 {
float: right;
padding-left:35px;
background: url(../../images/locate.png);
height: 30px;
background-size: cover;
background-size: 30px;
background-repeat:no-repeat;
width:65px;
}
I can recreate the angularjs plunker if necessary.
EDIT a couple of notes:
- this is only happening in Chrome, not in FF or Safari
- the 'Change City' input div uses Angular UI Bootstrap typeahead which seems to add a .dropdown-menu class div - but it has zero dimensions (see screenshot below)
- the empty typeahead dropdown results div code appears and is identical in both correct and incorrect states
I think this is a bug in how Chrome treats the angular-ui bootstrap typeahead directive (based on the fact that we're not seeing this error in either FF or Safari)
The order things are happening seems to be:
- on initial load, the DOM only loads existing html/CSS elements
- once the DOM is loaded, the ng directive then adds the empty typeahead dropdown div, which sits 'below' the locate2 div on the screen despite being written in the DOM between existing divs
ie as the browser reads through the DOM it places:
- input div 1st
- locate2 div 2nd
- invisible dropdown div added last via directive
On returning to the page via ui-router:
- the DOM now includes the additional dropdown element between input and locate2 divs
- each html element is treated in the order it's read in the DOM
- this means that the 'invisible' dropdown div now pushes the locate div out of the way...(in Chrome)
ie as the browser reads through the DOM on returning to the template it places:
- input div 1st
- invisible dropdown div 2nd
- locate2 div 3rd
For whatever reason, Chrome is treating the dropdown not as a hidden div, but as a collapsed visible(?) div and pushing the locate2 div out of place.
On moving the locate2 div to before the change-city div, the injected dropdown code no longer interferes with locate2 div.
In the 'fix', as the browser reads through the DOM it places:
- locate2 div 1st
- input div 2nd
- invisible dropdown div 3rd
I'm having a problem with input elements:
Even though in that picture their css is
margin: 0;
padding: 0;
They still have that slight margin I can't get rid of. I had to use a negative margin of -4px to get the button to stay close to the text field.
Also, when doing further styling I end up with a problem between Firefox and Chrome:
submit buttons seem to not have the same height. Setting an height which makes the submit button fit together with the input bar on Chrome breaks it on Firefox and vice-versa. There seems to be no apparent solution.
1px difference between buttons http://gabrielecirulli.com/p/20110702-170721.png
In the image you can see that where in Chrome (right) the button and input field fit perfectly, in Firefox they'll have a height difference of 1px.
Is there a solution to these 2 problems (the persistent margin and the 1px difference)?
EDIT: I've fixed the first problem, it was caused by the fact that the two elements were separated by a newline in the html code.
The second problem persists, though, as you can see here:
by highlighting the shape of the two elements, you can see that in Firefox (left) the button is 2px taller than in Chrome (right)
Try this one: demo fiddle.
HTML:
<span><input type="text" /><input type="submit" /></span>
CSS:
span, input {
margin: 0;
padding: 0;
}
span {
display: inline-block;
border: 1px solid black;
height: 25px;
overflow: hidden;
}
input {
border: none;
height: 100%;
}
input[type="submit"] {
border-left: 1px solid black;
}
Tested on Win7 in IE8, IE9, Opera 11.50, Safari 5.0.5, FF 5.0, Chrome 12.0. Only IE7 fails since it obstinately shows a normal button-like submit input.
Seems to me that your CSS is interfering, somewhere, with your inputs layout.
As you can see here http://jsfiddle.net/F3hfD/1/ what you're asking is doable without any problem.
For your second issue, see How to reset default button style in Firefox 4 +
For a similar issue where I an image used as the button type="submit" and it wasn't exactly the same height as the input adjacent to it, I simply added this to the container of the two said inputs:
padding-bottom:1px;
I had a glyphicon in a span next to input, which was inserting top:1px.
So I set top:0px on span and the issue was fixed.
But actual answer for the thread is totally problem specific and user needs to better understand the elements and css to fix it.