1 reply [Last post]
Rallystas
Rallystas's picture
Offline
newbie
Last seen: 9 years 40 weeks ago
Timezone: GMT+2
Joined: 2013-02-22
Posts: 1
Points: 2

hi,
i have this html code:

    <div align="left" style="float:left;>blablabla...</div>
<div align="left" style="float:right; width:70%;>blablabla...</div>

the left floated div has not a width. so when the text inside it is large, it is not wrapped and the right div is going bellow the left div. it is possible to wrap the text when the left div is going to "touch" the right div?

i have this sample (created in Photoshop)

thanks in advance.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 39 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Since the right hand column

Since the right hand column has an explicit width, put it first in the source order. Then, do not float the left hand column; style it as {overflow: hidden;}, which will create a new block formatting context for it.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.