I am trying to change the width of an input (button) via CSS/ Can i do this? this is my code that failed... <style type="text/css"> input {width:10px;} </style> <input type="button" value="OOOOOOOOOOOOOOOO" onmouseover="style='width:100%'">
-
-
Answer:
You've specified the button width twice: once in the <style> tag and once in the <input> tag. I'm pretty sure the spec in the input tag takes precedence, so the 10px width should not be evaluated. The "width:100%" means that the button should have the same width as its parent element IIRC. Is this what you want? I recommend getting rid of inline styles and using an external stylesheet instead. I find it cuts down on confusion and makes for less typing. Your mileage may vary.
jkb3614 at Answerbag.com Visit the source
Other answers
Try this: <style type="text/css"> <!-- .button { display: inline-block; width: 120px; } .button:hover { width: 100%; } --> </style> <input type="button" class="button" value="Button" /> Try to avoid using inline CSS or Javascript. If you needed to use Javascript, you could do this, but I still highly recommend using CSS instead: <input type="button" class="button" value="Button" onmouseover="this.style.width='100%';" /> Good luck!
ClearNone
Try input.button {width:XXpx;} 10px is pretty small....
JimmyG
Related Q & A:
- How can I get the value of dynamically created input?Best solution by Stack Overflow
- How can I properly read data from bar code scanner?Best solution by Stack Overflow
- Can I send free text messages abroad via chikka in Saudi Arabia?Best solution by Yahoo! Answers
- I'am trying to change my profile picture?Best solution by Yahoo! Answers
- How can I make money at home using my computer without doing any type of multi-level marketing?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.