Re: Centering a DIV within a DIV?



Robert Latest wrote:

> On 27 Oct 2005 14:31:41 GMT,
> Robert Latest <boblatest@xxxxxxxxx> wrote
> in Msg. <3sc6mdFnh0saU2@xxxxxxxxxxxxxx>
>
>> me again. This time I'd like to align a DIV both horizontally and
>> vertically centered within a larger DIV.
>
> I just found the negative-margin trick. Kinda ugly, but works well
> enough.

Only until the viewport becomes smaller than the inner div.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
.



Relevant Pages

  • Re: How to get <DIV> in code behind page
    ... It renders a div. ... Microsoft MVP ... "Robert" wrote in message ... > For example, with the following tag, how do I get ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: display:inline block elements
    ... CES wrote: ... Within the row their is a <Div> that I want to align to the Right hand side of the <Div ... Align is not a valid attribute of the Div element... ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: display:inline block elements
    ... I was hoping that someone might be able to help me with a few questions on Aligning Block Elements properly... ... Within the row their is a <Div> that I want to align to the Right hand side of the <Div ... Align is not a valid attribute of the Div element... ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Vertical align of image in a div tag
    ... that I can align things correctly. ... The li1 tag is supposed to align ... Anyone know how to align the image vertically in the middle of the div ...
    (alt.html)
  • RE: images and text not aligning
    ... you are confusing how the align works with containers and elements. ... div an align defines how its content is aligned. ... it specifies how its aligned within the text flow (baseline). ...
    (microsoft.public.dotnet.framework.aspnet)