Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
ian2003 #1
centering a div tag usind css
i wish to centre a div tag on my page using css so that it remain in the centre of my page no matter how much i expand and retract my browser
thanks
ian2003 Guest
-
Centering Pages
Is there any way I could make Pub 2003 automatically (or manually in a simple way), center the entire page contents under the nav bar? I added a... -
Centering
In Publisher 2000, centering a title or headline between text that is full justified or left justified results in a bunch of extra space above and... -
Centering SWFs
This may be a silly question, but I can't seem to figure it out. How does one center a swf file on an HTML page without using a table? -
usind mv in a script
I know that you can find files and removed them after a certain number of days from creation date. Can you find files and move them to another... -
centering frames
I have created a site with 3 frames - navigation at the top (changes both frames below), navigation at the left side (changes content in frame at... -
-D- #2
Re: centering a div tag usind css
Using css, apply:
body { text-align: center;) //this is for Internet Explorer
for your container div
#container {margin: 0 auto; position: relative; width: 790px;} //use any
width you prefer
This will center your container div horizontally in the broswer window
Hope this helps.
Regards,
-D-
"ian2003" <webforumsuser@macromedia.com> wrote in message
news:dmn5vm$dpo$1@forums.macromedia.com...centre of my page no matter how much i expand and retract my browser> i wish to centre a div tag on my page using css so that it remain in the>
> thanks
-D- Guest
-
Murray *TMM* #3
Re: centering a div tag usind css
Wouldn't need the position:relative to make it center.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"-D-" <someone@NOSPAM.com> wrote in message
news:dmn72q$fer$1@forums.macromedia.com...> Using css, apply:
>
> body { text-align: center;) //this is for Internet Explorer
>
> for your container div
>
> #container {margin: 0 auto; position: relative; width: 790px;} //use any
> width you prefer
>
> This will center your container div horizontally in the broswer window
>
> Hope this helps.
> Regards,
> -D-
>
>
> "ian2003" <webforumsuser@macromedia.com> wrote in message
> news:dmn5vm$dpo$1@forums.macromedia.com...> centre of my page no matter how much i expand and retract my browser>> i wish to centre a div tag on my page using css so that it remain in the>>>
>> thanks
>
>
Murray *TMM* Guest
-
-D- #4
Re: centering a div tag usind css
Yep, the relative positioning isn't mandatory. I use a relative positioned
div so when I use absolute positioned divs within the container, they
position correctly.
"Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
news:dmndvm$q7n$1@forums.macromedia.com...any> Wouldn't need the position:relative to make it center.
>
> --
> Murray --- ICQ 71997575
> Team Macromedia Volunteer for Dreamweaver
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
> [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
> [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
> [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
> [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
> ==================
>
>
> "-D-" <someone@NOSPAM.com> wrote in message
> news:dmn72q$fer$1@forums.macromedia.com...> > Using css, apply:
> >
> > body { text-align: center;) //this is for Internet Explorer
> >
> > for your container div
> >
> > #container {margin: 0 auto; position: relative; width: 790px;} //usethe> > width you prefer
> >
> > This will center your container div horizontally in the broswer window
> >
> > Hope this helps.
> > Regards,
> > -D-
> >
> >
> > "ian2003" <webforumsuser@macromedia.com> wrote in message
> > news:dmn5vm$dpo$1@forums.macromedia.com...> >> i wish to centre a div tag on my page using css so that it remain in>> > centre of my page no matter how much i expand and retract my browser> >> >>
> >> thanks
> >
> >
>
-D- Guest
-
kirkdickinson #5
Re: centering a div tag usind css
I have a question on this too, so instead of starting a new topic, here goes.
I want to define a class in an external CSS file so that I can use the same
frame style all over my site. I want it to be 400 px wide and centered. I
can't find any setting in the CSS to tell it to be centered. The only things
for centering seem to center the text.
Here is my class:
.box400 {
background-color: #F5F5F5;
padding: 5px;
height: auto;
width: 400px;
border: 2px dotted #660000;
}
When I do my div with that class it works. If I add align=center to the same
div tag, it ignores the center command. I had to nest that div inside another
to get the dang thing to center. That shouldn't be needed.
I saw above where it said to define center in the body tag, but that won't
work on my site, because everything is layed out from the left and it alread
explicitly defines left in the body tag.
Thanks,
Kirk
kirkdickinson Guest
-
kirkdickinson #6
Re: centering a div tag usind css
I have a question on this too, so instead of starting a new topic, here goes.
I want to define a class in an external CSS file so that I can use the same
frame style all over my site. I want it to be 400 px wide and centered. I
can't find any setting in the CSS to tell it to be centered. The only things
for centering seem to center the text.
Here is my class:
.box400 {
background-color: #F5F5F5;
padding: 5px;
height: auto;
width: 400px;
border: 2px dotted #660000;
}
When I do my div with that class it works. If I add align=center to the same
div tag, it ignores the center command. I had to nest that div inside another
to get the dang thing to center. That shouldn't be needed.
I saw above where it said to define center in the body tag, but that won't
work on my site, because everything is layed out from the left and it alread
explicitly defines left in the body tag.
Thanks,
Kirk
kirkdickinson Guest
-
Murray *TMM* #7
Re: centering a div tag usind css
You're looking to style a FRAME with CSS? Or did you mean <div>?
No it doesn't. It will center the inline content you put into it.> If I add align=center to the same
> div tag, it ignores the center command.
So - you are trying to make the <div> tag itself center in its container?> I had to nest that div inside another
> to get the dang thing to center.
Then you would have to give that <div> a width and assign auto left and
right margins. For example, this div will be centered -
body { text-align:center; }
#centeredDiv { width:300px;border:1px solid blue;margin:0 auto; }
.....
<body>
<div id="centeredDiv">take a look</div>
</body>
And it's not.> That shouldn't be needed.
That's OK. Go ahead and use the text-align:center.> I saw above where it said to define center in the body tag, but that won't
> work on my site, because everything is layed out from the left and it
> alread
> explicitly defines left in the body tag.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"kirkdickinson" <webforumsuser@macromedia.com> wrote in message
news:dnvgpo$28d$1@forums.macromedia.com...>I have a question on this too, so instead of starting a new topic, here
>goes.
>
> I want to define a class in an external CSS file so that I can use the
> same
> frame style all over my site. I want it to be 400 px wide and centered.
> I
> can't find any setting in the CSS to tell it to be centered. The only
> things
> for centering seem to center the text.
>
> Here is my class:
> .box400 {
> background-color: #F5F5F5;
> padding: 5px;
> height: auto;
> width: 400px;
> border: 2px dotted #660000;
> }
>
> When I do my div with that class it works. If I add align=center to the
> same
> div tag, it ignores the center command. I had to nest that div inside
> another
> to get the dang thing to center. That shouldn't be needed.
>
> I saw above where it said to define center in the body tag, but that won't
> work on my site, because everything is layed out from the left and it
> alread
> explicitly defines left in the body tag.
>
> Thanks,
>
> Kirk
>
Murray *TMM* Guest
-
kirkdickinson #8
Re: centering a div tag usind css
> You're looking to style a FRAME with CSS? Or did you mean <div>?
I wanted to use a Div to define a box.
Yeah, it centers the content inside the div. I was trying to define the div>No it doesn't. It will center the inline content you put into it.
itself to center. That is why I had to nest the div's.
Yep.>So - you are trying to make the <div> tag itself center in its container?
Yes, that works, but when I set body { text-align:center; } it causes other>Then you would have to give that <div> a width and assign auto left and
>right margins. For example, this div will be centered -
>
>body { text-align:center; }
>#centeredDiv { width:300px;border:1px solid blue;margin:0 auto; }
>....
>
><body>
><div id="centeredDiv">take a look</div>
></body>
problems on the site.
Thanks
kirkdickinson Guest
-
Murray *TMM* #9
Re: centering a div tag usind css
Leave the text-align:left in the body tag and it will all come out in the
wash.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"kirkdickinson" <webforumsuser@macromedia.com> wrote in message
news:do04p7$qf4$1@forums.macromedia.com...>>> You're looking to style a FRAME with CSS? Or did you mean <div>?
> I wanted to use a Div to define a box.
>>> >No it doesn't. It will center the inline content you put into it.
> Yeah, it centers the content inside the div. I was trying to define the
> div
> itself to center. That is why I had to nest the div's.
>>> >So - you are trying to make the <div> tag itself center in its container?
> Yep.
>>> >Then you would have to give that <div> a width and assign auto left and
> >right margins. For example, this div will be centered -
> >
> >body { text-align:center; }
> >#centeredDiv { width:300px;border:1px solid blue;margin:0 auto; }
> >....
> >
> ><body>
> ><div id="centeredDiv">take a look</div>
> ></body>
> Yes, that works, but when I set body { text-align:center; } it causes
> other
> problems on the site.
>
> Thanks
>
Murray *TMM* Guest



Reply With Quote

