Making the options of a display vertically in struts2

前端 未结 5 1122
耶瑟儿~
耶瑟儿~ 2021-01-05 20:50

*I need my check box list option to display vertically instead of the default horizontal display.I have created a folder in my src folder in the name templates and another f

5条回答
  •  既然无缘
    2021-01-05 21:39

    I tried the answer supplied here, but it did not work as I'd hoped, I lost the label on the list, and also other formatting disappeared. So, I did it through css:

    
    

    which results in html-elements like this:

    
    

    The CSS for making the checkboxes vertical then looks like this:

    label[for*=myCheckboxList-]:after {
        content:"\A"; white-space:pre;
    }
    

    The selector states that "after each label with a for-attribute containing 'myCheckboxList-'", and the contents state "add a linebreak ("\A") and make sure that whitespaces are preserved".

提交回复
热议问题