-2
I need to help figure out how to "break line" dentro
tag.
For example: I have a 200px label and every name that is inside the label tag larger than 200px, should break line and move to the line below, thus pushing the other Abels down.
See how I’m trying to do, but it’s not working:
Veja no trecho de código
The text should appear until more or less the word free and move to the line below, but is not "breaking".
I’m not using any other code besides the style I’m demonstrating on the tag label itself.
<fieldset style='position:relative;width:100%;max-width:600px;min-width:305px;text-align:left;border:1px solid rgba(121,138,151,0.5);border-radius:3px;padding:0 5px 10px 5px;'>
<legend>Programa social</legend>
<legend style='position:absolute;top:-1px;right:5px;background:#fff;'>
<div onclick='modalSocial();'>Incluir Programa</div>
</legend>
<div style='position:relative;margin:0 0 20px 5px;'>Clique com o botão direito do mouse sobre um Programa Social para ler a descrição</div>
<div style='position:relative;margin:5px 0;'>
<input type='checkbox' id='chpsa' name='psoc[]' value='xxxxx'>
<label for='chpsa' style='position:absolute;left:0;'></label>
<label for='chpsa' style='position:relative;width:200px;word-break:break-word;overflow:hidden;'>
Lorem ipsum ante mi vel sagittis libero aliquam quisque praesent aliquet suspendisse etiam praesent, senectus aenean sapien mi dapibus sit aptent eu consequat pellentesque est.
</label>
<br>
<input type='checkbox' id='chpsb' name='psoc[]' value='xxxxx'>
<label for='chpsb' style='position:absolute;left:0;'></label>
<label for='chpsb' style='position:relative;width:200px;word-break:break-word;overflow:hidden;'>
Lorem ipsum ante mi vel sagittis libero aliquam quisque praesent aliquet suspendisse etiam praesent, senectus aenean sapien mi dapibus sit aptent eu consequat pellentesque est.
</label>
<br>
<input type='checkbox' id='chpsc' name='psoc[]' value='xxxxx'>
<label for='chpsc' style='position:absolute;left:0;'></label>
<label for='chpsc' style='position:relative;width:200px;word-break:break-word;overflow:hidden;'>
Lorem ipsum ante mi vel sagittis libero aliquam quisque praesent aliquet suspendisse etiam praesent, senectus aenean sapien mi dapibus sit aptent eu consequat pellentesque est.
</label>
</div>
</fieldset>
As I said in my question (in bold): I’m not using! and the snippet really changes even!
– nouvo
OK thanks @Sam... I put it the way it is and removed the print.... "suck on this sleeve" rs
– nouvo
I tried it like this (display:inline-block), but I didn’t give @Sam... and if I don’t put the overflow:Hidden, the label breaks the fieldset line.
– nouvo
'Cause it’s @Sam... I’ll post the image of the project for you to see what happens... Note that the
Programa de Fomento
is cut and does not break line..... and if I remove the overflow, it completes everything in one line only– nouvo
Yes @Sam! Two columns because the DIV that holds the checkboxes will repeat itself according to the query of mysql and is with style display:inline-block... are many social programs, many even, so the need for the column... see the second image with the same code that I used here in the snippet. The label (with display:inline-block) does not break line at all.
– nouvo
My little boss, unable to reproduce the code and not knowing what you want to do (so far I do not understand), it is difficult to help.
– Sam
I’ll keep searching... thanks @Sam, you’re very kind!
– nouvo
Blz... just don’t use overflow that has nothing to do with line breaking. Good luck!
– Sam