How to center this progress bar in text widget?

  • Unknown's avatar

    Code:
    <div style=”border:1px solid #ccc;width:100px;float:left;background:white;margin:2px 5px 2px 0;padding:1px;”>

    I can’t seem to center this. I tried div = aligncenter or <center> around it but it won’t work. Any ideas?

    Also it seems if I add text, it never goes to next line, does anyone have any ideas?

    The blog I need help with is: (visible only to logged in users)

  • Hi there. You’re using outdated and deprecated html. The <center> tag is no longer used in html5, nor is the align=”center” attribute. That’s why it won’t work.

    To align text inside a div you need to add “text-align: center” inside the quotes for your style attribute. To center the div itself you need to use margins. Normally “margin: auto” centers a div within its parent element, but I’ve noticed it doesn’t always work correctly in widgets. In that case, set the margin-left to a specific value until it looks right to you.

  • The topic ‘How to center this progress bar in text widget?’ is closed to new replies.