DVK
DVK

Reputation: 129403

How can I control button margins using CSS (IE8 compatible)

I am trying to style buttons so that the margins to the left/right of the text are much smaller than default style.

Example:

enter image description here

How can I do that using CSS that is compatible with IE8?

I tried this but didn't work (line breaks are only for MarkDown's sake):

<button style="font-size=11px;
margin-right:1px;padding-right:1px;margin-left:1px;padding-left:1px;">
Copy parameters to another fund</button>

I know I can tweak this by setting the width attribute, but for that I'd have to set individual with for every single different text which isn't scalable.

Upvotes: 0

Views: 134

Answers (1)

mplwork
mplwork

Reputation: 1140

Make sure to include a doctype. This works for me:

<!doctype html>
<body>
<button style="font-size=11px;
      margin-right:1px;padding-right:1px;margin-left:1px;padding-left:1px;">
        Copy parameters to another fund
    </button>
</body>

Actually, you don't need the margins, padding will do.

Upvotes: 2

Related Questions