thanhbebi
thanhbebi

Reputation: 163

White space after wrap text in HTML

enter image description here

As you can see, there is a right white space. This is my code:

<style>
    div {
        width: 480px;
        word-wrap: break-word;
    }
    html,body {
        margin: 0;
        padding: 0;
    }
</style>

Please help me remove it. Tks

Upvotes: 0

Views: 1845

Answers (2)

Jazi
Jazi

Reputation: 6732

Just change div's width value from 480px to 100%:

So... change this:

width: 480px;

on this:

width: 100%;

But, if You want to center this <div> with Your content, just add following to div CSS selector:

margin: 0 auto;

Upvotes: 2

Marvin Fischer
Marvin Fischer

Reputation: 2572

<STYLE>div{width:100%;word-wrap:break-word;} html,body{margin:0;padding:0;}</STYLE>

This should be all

Upvotes: 2

Related Questions