Input components width is different between IE/Chrome

UI Components for JSF
Post Reply
babaguna
Posts: 8
Joined: 06 Oct 2011, 16:04

09 Sep 2014, 14:11

Hi, am I missing something or there is a problem when using "size" property of "inputText" component?
When the size is specified using style="width: ??px;" the width is fine but when using only "size" - the component appears wider in Chrome.

The project is created in NetBeans 7.4 as default Web Application with JSF and PrimeFaces and the only thing I've added is the inputText.

You can see the difference here:
Image

Here is the code:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
Hello from Facelets
<br />
<h:link outcome="welcomePrimefaces" value="Primefaces welcome page" />
<br />
<h:form>
<p:inputText size="15"/>
</h:form>
</h:body>
</html>

Thanks.
PF 4.0, Mojarra 2.2.5, Glassfish 4.0

mcoming
Posts: 2
Joined: 09 Sep 2014, 18:56

09 Sep 2014, 19:08

Font size might be different between browsers. Size=15 means 15 characters.
Mojarra 2.2.6, PrimeFaces 5.0, Tomcat 8, Glasfish 4

mcoming
Posts: 2
Joined: 09 Sep 2014, 18:56

09 Sep 2014, 19:13

Font size might be different between browsers. size=15 means 15 characters. In the HTML source code, the input element size is the same (15).
Mojarra 2.2.6, PrimeFaces 5.0, Tomcat 8, Glasfish 4

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

10 Sep 2014, 10:24

This is because different browsers do different things. Use css rules to control the width of input components only.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

babaguna
Posts: 8
Joined: 06 Oct 2011, 16:04

10 Sep 2014, 15:39

We have a few thousand components... this can't be true... specifying the width of each one :(
PF 4.0, Mojarra 2.2.5, Glassfish 4.0

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

10 Sep 2014, 17:53

don't blame PF, blame M$, Mozilla, G00gle etc... ;-)

https://www.google.nl/search?q=html+inp ... ifferences

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: VjiupsLuh and 58 guests