views:

998

answers:

2

I have an element that is similar to a tag (because it has word-wrap: pre;) to display code on a website. The only problem is that the tab size is too large and causes the element to horizontally scroll often because it is of fixed width.

Is it possible to change the tab size?

+2  A: 

You could replace tabs with spaces. Then you could control exactly the size of the indents.

recursive
A: 

We need some more clarity into your question, but are you perchance looking for the text-indent css property? You can set the indentation amount, e.g.:

<style type="text/css">
p {
  text-indent: 40px;
}
</style>
cLFlaVA
`text-indent` only applies to the first line of text in the matching element(s): http://www.w3.org/TR/CSS2/text.html#indentation-prop
Andrew