Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: input styling
04-25-2011, 02:33 PM #1
- Join Date
- Dec 2010
- Thanked 0 Times in 0 Posts
I have an annoying styling issue on a webpage that I do not understand.
If you open this page and click on audio. Then you will see two line both starting with "Select again.." but you will also notice that their not completely aligned. The buttom line is moved slightly to the left. Why is this?
Tryed using firebug to compare the styling for both lines but have not been able to spot anything wrong.
Appreciate any help
04-25-2011, 02:52 PM #2
- Join Date
- Jan 2006
- Halle (Saale), Germany
- Thanked 1,143 Times in 1,114 Posts
It looks different because line breaks count as text nodes and generate a white space. In your hard coded HTML you have added line breaks for proper formatting but the stuff you’re adding dynamically is theoretically all added one after the other on a single line so there are no white spaces. You could add whitespaces with JS, too. I don’t know if adding a new line (
\n) with JS also does the trick.
On another note: I hope that this is just a test case and eventually you’re going to use a proper form with proper labels for each input.