473,378 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

width of a text input

xNephilimx
213 Expert 100+
Hi, there.

I'm trying to separate as much as I can the display form the conten, say CSS from HTML, but I encountered a little compatibility issue...
I'm trying to set the width in pixels of a text input element from a CSS using the width attribute and it works fine with Firefox, but not in IE (not a surprise BTW), how can I make it work?.

Here's an example of what I'm telling you:

In the CSS file
Expand|Select|Wrap|Line Numbers
  1. input[type="text"], input[type="password"] {
  2.     /* Some properties */
  3.     width: 200px;
  4. }
  5.  
In the HTML
[HTML]
<!-- some form code -->
<input type="text" name="user" />
<input type="password" name="pass" />
<!-- some form code -->
[/HTML]
Jun 20 '07 #1
2 1983
drhowarddrfine
7,435 Expert 4TB
It works for me. .
Jun 21 '07 #2
xNephilimx
213 Expert 100+
It works for me. .
Mmm.. may be because I have IE 6.x and it's fixed in IE7?
Jun 21 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: johkar | last post by:
I have a grid. When the focus is put on a cell an input is created with the value being the cell's text. I would like to size the input to the physical width of the text. Ideas? John ...
2
by: Kai Grossjohann | last post by:
I would like to put a text input field (in the sense of <input type="text">) and an image next to each other, where I know the size in pixels of the image, and I know the total width in em. I...
8
by: BiNZGi | last post by:
Hi I have reduced the problem to this code: <form> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td><input type="text" style="width: 100%;" value="Lorem ipsum dolor...
17
by: Piers Lawson | last post by:
If the following is displayed in IE6 or FireFox, the text box forces the second DIV to expand beyond its 15em width. Is there a way to have the text box fit within the DIV (preferably without...
1
by: NullBock | last post by:
Hi, I'm trying to create a form with a text-input (not textarea) that expands to the size available, using CSS. I thought that a simple display:block would work: <form> <div> <input...
1
by: Shadow Lynx | last post by:
Consider this simple HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 STRICT//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head>...
4
tolkienarda
by: tolkienarda | last post by:
hi all i am printing out a bunch of html code with a php script and i am not sure if my html syntax or my php syntax, everything works and displays the way i want but the width tags for the text...
2
by: xtian | last post by:
Hi, I have been having some trouble with getting a column to be a fixed width. I have a table with 11 columns, so it doesn't all fit in a normal browser window. One of the cells has a "?" and then...
4
by: lilOlMe | last post by:
Hi there! I'm developing a "scrollable table". At first I started using CSS. It worked pretty well until I found a bug that happens when placing this table into a tabbing control... So I...
2
by: kolik | last post by:
Hello. Is there anybody who can give me an explanation, why the actual width of the textboxes in my two examples is different? (Second example is missing a DocType declaration.) After that, I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.