Professional Web Applications Themes

Centering div with CSS - Macromedia Dynamic HTML

I am trying to center a div (container) with CSS so that it will stay centered when the browser window is resized. How do I do that? I've tried different routes, but nothing has worked so far?...

  1. #1

    Default Centering div with CSS

    I am trying to center a div (container) with CSS so that it will stay centered when the browser window is resized. How do I do that? I've tried different routes, but nothing has worked so far?
    pixelchick80 Guest

  2. #2

    Default Re: Centering div with CSS

    What routes have you tried? And show us how you have done it. It's
    possible you tried the right method, and botched it.

    Have you given the div a width, and auto left/right margins? That will
    center it within its container.


    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com - Template Triage!
    http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs, Tutorials & Resources
    http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
    ==================


    "pixelchick80" <com> wrote in message
    news:f08orh$99e$macromedia.com... 


    Murray Guest

  3. #3

    Default Re: Centering div with CSS

    You are AWESOME!! I had the width set, but did not set the left/right margins
    to auto. That did the trick.

    Here's another issue:
    I work on a Mac OS X 10.4.9. When I view the page in IE 7 on a PC, it's fine,
    but when I look at it in IE6, the first text block is about 4" or so down from
    where it should be. Is there some sort of hack that can fix this problem? Here
    are the links to view what I have.
    http://home.nc.rr.com/natalienobles/zengarden-sample.html
    http://home.nc.rr.com/natalienobles/zengarden-sample.css

    pixelchick80 Guest

  4. #4

    Default Re: Centering div with CSS

    Make the text's container 3px narrower.

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com - Template Triage!
    http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs, Tutorials & Resources
    http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
    ==================


    "pixelchick80" <com> wrote in message
    news:f090jl$hpp$macromedia.com... 


    Murray Guest

  5. #5

    Default Re: Centering div with CSS

    It's still kicking the first block of text way down on the page. Any other suggestions?
    pixelchick80 Guest

  6. #6

    Default Re: Centering div with CSS

    Let's see your page after your changes, please.

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com - Template Triage!
    http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs, Tutorials & Resources
    http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
    ==================


    "pixelchick80" <com> wrote in message
    news:f0iem8$18k$macromedia.com... 


    Murray Guest

  7. #7

    Default Re: Centering div with CSS

    I've been adjusting the container through the padding in the CSS panel
    (#preamble). Is that wrong? Here are my links again. It's just that one box
    that is giving me a problem. Everything else is displaying properly. Could it
    possibly be something within the header section of the html? Thanks for the
    help.

    http://home.nc.rr.com/natalienobles/zengarden-sample.html
    http://home.nc.rr.com/natalienobles/zengarden-sample.css

    pixelchick80 Guest

  8. #8

    Default Re: Centering div with CSS

    > I've been adjusting the container through the padding in the CSS panel 

    If you look at this link in both IE and FF, you may get a clue where to go
    next -

    http://murraytestsite.com/zen.html

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com - Template Triage!
    http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs, Tutorials & Resources
    http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
    ==================


    "pixelchick80" <com> wrote in message
    news:f0iri1$hh1$macromedia.com...
    Here are my links again. It's just that one box 


    Murray Guest

  9. #9

    Default Re: Centering div with CSS

    The red outline means that the margin is collapsing on Firefox but not on
    IE. If you want to adjust the vertical position of the content, you would
    use padding.

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com - Template Triage!
    http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs, Tutorials & Resources
    http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
    ==================


    "pixelchick80" <com> wrote in message
    news:f0j0fk$nkv$macromedia.com... 


    Murray Guest

  10. #10

    Default Re: Centering div with CSS

    I said that I was adjusting the container with padding, but it was actually margin.

    Does the red box mean that I should adjust the padding instead of the margins?
    pixelchick80 Guest

Similar Threads

  1. Centering
    By analog@logwell.com in forum Web Design
    Replies: 4
    Last Post: June 26th, 03:12 AM
  2. Centering SWFs
    By lightwriting webforumsuser@macromedia.com in forum Macromedia Flash Sitedesign
    Replies: 10
    Last Post: February 29th, 08:43 PM
  3. centering frames
    By Gwendolyn Shangle in forum Macromedia Dreamweaver
    Replies: 0
    Last Post: July 19th, 03:11 PM
  4. centering layers
    By snakeinthefly webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 2
    Last Post: July 17th, 08:11 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139