customise or create similar style

Re: customise or create similar style

by David Scotson -
Number of replies: 0
Hi,

`.book_content pre.file` means "any pre section with the class '`file`', somewhere inside any item (e.g. div, p etc.)with a `.book_content` class.


`.book_content pre .file` (with the space) means "any item (e.g. pre, p, span etc.) with the class '`file`', somewhere inside a pre tag which is in turn inside any item with a `.book_content` class.

They won't interfere with each other since you'd need to have a `pre class="file"` inside another pre class="file"` in order for both to apply to the same section.

For your second question, in _theory_ `pre` is used for any preformatted text where you want to put in linebreaks like poetry for instance. On the other hand `code` is for designating computer code, things to type into command line prompts etc.

So if you want multiple lines of computer code, you really should use both.

But from you example it seems like you might want to refer to a variable or command inside a normal paragraph of text like when I refered to CSS class names above. If you put those in pre tags they'll be in a paragraph of their own. In code tags they'll just sit in the flow of the sentence.

edit: annoyingly there appears to be a filter running on these forums that grabs any such code tags and reformats them in pre tags as if they were PHP so I can't really demonstrate it live.