Anyone may have noticed the first space character written at the beginning of every line gets trimmed for codes. It bothers a lot when copying a long code with original user's formatting and you must end up by quoting someone's post or editing your own, in order to view its source.
Adding white-space: pre-wrap; at #CODE into the CSS theme file will solve the issue. It works on FF but IE refuses such fix. It is due to the incomplete !DOCTYPE that GTAF uses, thus IE recognizes it as invalid. Using a proper !DOCTYPE means re-working on the style sheet again just for a little thing (it will fix other HTML/CSS issues aswell, though). Alternatively, considering that the CODE BB tag creates a two-lines table, one for displaying "CODE" and one for showing the code with id=CODE applied, I would suggest you to put the whole code within the <pre> HTML tag in the single cell of the second table line, by leaving the id=CODE attribute untouched. Do not forget to set margin: 0px to PRE in the CSS file.
Note: the last one is a cross browser solution. Then, you mustn't call the nl2br PHP function to convert new lines into <br> tags anymore, otherwise IE will collapse all consecutive line breaks. Both solution don't affect any visible modification to the forum's layout, it's 100% tested.
- This forum is for suggestions regarding this website - NOT suggestions regarding the Grand Theft Auto series!
- This is not Rockstar's official forum. This website is operated by fans. Rockstar does not have an official forum.
- Search to check if your suggestion has been posted before.
Preserving all white spaces for CODE
No replies to this topic