Re: css question
- From: "Kevin Spencer" <unclechutney@xxxxxxxxxxxx>
- Date: Thu, 8 Nov 2007 06:58:36 -0500
Put the image inside a div with the div's width style set to "1px", and its'
left-margin and right-margin styles set to "auto". Put the div inside the
div you want to center the image in. The inner div will stretch its' width
to accomodate the image and be centered in the outer div.
--
HTH,
Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP
"Tem" <tem1232@xxxxxxxxx> wrote in message
news:eATD6KWIIHA.1164@xxxxxxxxxxxxxxxxxxxxxxx
Thanks. how do I center the image in the div?
"Kevin Spencer" <unclechutney@xxxxxxxxxxxx> wrote in message
news:OBmMmZTIIHA.4688@xxxxxxxxxxxxxxxxxxxxxxx
If you had tried Nick's suggestion, you would have seen that this is
exactly what it does.
--
HTH,
Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP
"Tem" <tem1232@xxxxxxxxx> wrote in message
news:ewLEByLIIHA.4688@xxxxxxxxxxxxxxxxxxxxxxx
That won't work because I need to set the width of the image, 80% of the
width of the parent element, the div.
Can this be done with CSS?
"Nick Chan" <zzzxtreme@xxxxxxxxx> wrote in message
news:1194345302.205603.6240@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
could u do something like this?
<div class="a1" style="width:100%"><img src="test.jpg" style="width:
80%" /></div>
On Nov 6, 1:22 pm, "Tem" <tem1...@xxxxxxxxx> wrote:
Is this possbile with css or do I need to use javascript? If so how?
<div class="a1" style="width:100%"><img src="test.jpg" /></div>
The width of the div is a variable. Can I scale the img accordingly?
img width is 80% of the width of the div
Tem
.
- References:
- css question
- From: Tem
- Re: css question
- From: Nick Chan
- Re: css question
- From: Tem
- Re: css question
- From: Kevin Spencer
- Re: css question
- From: Tem
- css question
- Prev by Date: Re: Public Shared Property in a DLL
- Next by Date: Re: what's different between asp application and web site
- Previous by thread: Re: css question
- Next by thread: Re: css question
- Index(es):
Relevant Pages
|