Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Can I make the container DIV of an image not taller than the image (HTML 4.01)?

Reply
Thread Tools

Can I make the container DIV of an image not taller than the image (HTML 4.01)?

 
 
Vince C.
Guest
Posts: n/a
 
      06-30-2003
Hi,

Might be a stupid question but bear with me. I feel newbie since I plunged
into HTML 4.01... I'd like a DIV to contain an image to the right side. The
image should set the DIV maximum height. If the contained text inside the
div overflows, the DIV should scroll vertically. Can I achieve this?

Thanks,
Vince C.


 
Reply With Quote
 
 
 
 
Vince C.
Guest
Posts: n/a
 
      07-01-2003
Thanks a lot, Ernest.

I needed such simple things for what I write tends to be much too
complicated... I have to get used to HTML 4.01

Thanks again.
Vince C.

------

"Ernest Cline" <(E-Mail Removed)> a écrit dans le message de
news:bdpgq5$h27$(E-Mail Removed)...
>
> "Vince C." <(E-Mail Removed)> wrote in message
> news:3f001368$0$288$(E-Mail Removed) e...
> > Hi,
> >
> > Might be a stupid question but bear with me. I feel newbie since I

plunged
> > into HTML 4.01... I'd like a DIV to contain an image to the right side.

> The
> > image should set the DIV maximum height. If the contained text inside

the
> > div overflows, the DIV should scroll vertically. Can I achieve this?

>
> Yes and no. It will require using CSS as well and it will be a lot easier
> if you know the dimensions of your picture. If you don't know the size,
> you'll have to make some compromises about your design and settle for
> something similar to what you want.
>
> In the following examples, I'll assume that the picture is 100px wide and
> 200px high. I'll also be using inline CSS via the style attribute and

that
> unless otherwise specified, that the margin, border and padding of all
> elements have been set to 0px.
>
> Scenario 1: You want the picture at upper right. and don't care where the
> text goes.
>
> <DIV style="height:200px;overflow:auto">
> <IMG style="float:right">
> Your text here.
> </DIV>
>
> If you want the scrollbar to always be there you'd use overflow:scroll
> instead.
>
> Scenario 2: You want the picture at the upper right, but you don't want

the
> text under the picture.
>
> <DIV style="height:200px;overflow:auto">
> <IMG style="float:right">
> <DIV style="margin-right:100px">
> Your text here.
> </DIV>
> </DIV>
>
> Scenario 3: You want the picture at right and for it to stay visible and

in
> place as the text scrolls.
>
> <DIV>
> <IMG style="float:right">
> <DIV style="height:200px;overflow:auto;margin-right:100px">
> Your text here.
> </DIV>
> </DIV>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's causing drop-down box in Firefox to appear taller? Mark B ASP .Net 1 02-09-2010 10:29 AM
Taller de B/N digital avanzado - Hugo Rodriguez espaifotografic Digital Photography 0 06-12-2009 08:57 PM
How to make a "container" div a certain size as well as centre it. xxfiredragonxx HTML 0 12-19-2005 10:10 PM
Need to find a div's container div's classname and id benjamin Javascript 2 11-16-2005 09:50 PM
Q: Div A inside Div B is larger than Div B Dwayne Madsen Javascript 1 06-01-2005 03:02 PM



Advertisments