The margin is required when the html code is generated by web2py in one 
string without line breaks and the elements are "inline elements" (as the 
"input" element is).

Please in a view put following code

<span>case #1</span>
{{=DIV(INPUT(_type='text',_value='first 
element'),'\n',INPUT(_type='text',_value='second 
element'),INPUT(_type='text',_value='third element'))}}
<br/>
<span>case #2</span>
{{=DIV(INPUT(_type='text',_value='first 
element',_style='margin-right:4px;'),INPUT(_type='text',_value='second 
element'),INPUT(_type='text',_value='third element'))}}
<br/>
<span>case #3</span>
<div>
 <input type='text' value='first element'/>
 <input type='text' value='second element'/>
 <input type='text' value='third element'/>
</div>
<br/>
<span>case #4</span>
<div><input type='text' value='first element'/><input type='text' value='second 
element'/><input type='text' value='third element'/></div>

In cases #1 and #2 we have a space between first and second element, but not 
between 
the second and third elements.
Case #3 shows the correct rendering (the code is in a block)
Case #4 shows the wrong rendering (the code is in a line)

To solve the issue you should override the css rule in web2py.css:

.input-append>input
{
margin-right:0;
}




Il giorno lunedì 22 ottobre 2012 22:40:53 UTC+2, Richard ha scritto:
>
> Hello,
>
> This line in web2py.css prevent the use of "Prepended and appended inputs" 
> of the bootstrap :
>
> Line 33 of web2py.css (web2py 2.1.1)
> input[type=text],input[type=password],select{width:300px; margin-right:5px}
>
> The problem come from the "margin-right:5px"
>
> There should be not margin-right in order to allow the .add-on button to 
> be paste just below the input field...
>
> In order to test it someone could just use Chrome and inspect a input 
> field append "input-append" to the field div class (formstyle=divs) :
> Ex.: class="w2p_fw input-append" 
> Append a span like this one to the field div :
> <span class="add-on">.00</span>
> And set a id to the input :
> id="appendedInput"
> But this not seems to be required even if it explained like this on 
> bootstrap site.
>
>
> Why do we use the margin-right for? Could it be removed or replaced by a 
> container and magin-left ?
>
> Richard
>  
>

-- 



<<attachment: inline_elements_rendering.png>>

Reply via email to