User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 397,785 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,376 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 15228 | Replies: 28
Reply
Join Date: Aug 2006
Location: braintree
Posts: 57
Reputation: bazmanblue is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
bazmanblue bazmanblue is offline Offline
Junior Poster in Training

Re: How to have the div layer center on any browser?

  #11  
Nov 2nd, 2006
i think this is what you mean. not certain as still learning
[HTML]<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />[/HTML]
To get 1000 links to free ad sites visit
http://www.freeaddsgalore.me.uk
For FREE:!:
Reply With Quote  
Join Date: Dec 2004
Posts: 1,590
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: How to have the div layer center on any browser?

  #12  
Nov 2nd, 2006
No. "Doctype" is short for "Document Type", and specifies to the browser the HTML/XHTML version your page is using. Until you know about doctypes and the various underlying DOMs they represent, you'll be shooting in the dark.

http://alistapart.com/stories/doctype/
Last edited by tgreer : Nov 2nd, 2006 at 2:27 pm.
Reply With Quote  
Join Date: Aug 2006
Location: braintree
Posts: 57
Reputation: bazmanblue is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
bazmanblue bazmanblue is offline Offline
Junior Poster in Training

Re: How to have the div layer center on any browser?

  #13  
Nov 2nd, 2006
hmm is this it?
[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/HTML]
To get 1000 links to free ad sites visit
http://www.freeaddsgalore.me.uk
For FREE:!:
Reply With Quote  
Join Date: Dec 2004
Posts: 1,590
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: How to have the div layer center on any browser?

  #14  
Nov 2nd, 2006
Yes. Ok, so you're using XHTML. Tell me again (so I don't have to re-read the entire thread), what you're trying to achieve? There is no "center" attribute in XHTML. To do horizontal centering, you have to set the left and right margins to "auto". The CSS attributes are:

  margin-left: auto;   margin-right: auto

Vertical centering is another issue entirely, and it depends on whether you're working with elements of known vs. unknown height.

Study this source of this page for an example.

Also, this page gives a complete discussion of CSS centering techniques.
Last edited by tgreer : Nov 2nd, 2006 at 3:14 pm. Reason: Fixed a typo.
Reply With Quote  
Join Date: Aug 2006
Location: braintree
Posts: 57
Reputation: bazmanblue is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
bazmanblue bazmanblue is offline Offline
Junior Poster in Training

Re: How to have the div layer center on any browser?

  #15  
Nov 2nd, 2006
Thanks.
well i have the main div layer on margin: auto auto and this comes out fine on the browser.
now i need all the layers i have included on top of this layer or inside to move with this layer in the same position when the browser size changes.
here is how i have the layers
[HTML]<div class="style1" id="Layer1"><img src="dmlayer1.png" width="800" height="800" />
<div id="Layer7"></div>
<div id="Layer6"></div>
<div id="Layer5">
<div align="left"> </div>
</div>
<div id="Layer4">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="501" height="115">
<param name="movie" value="dmtitle.swf" />
<param name="quality" value="high" /><param name="LOOP" value="false" />
<embed src="dmtitle.swf" width="501" height="115" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
</object>
</div>
<div id="Layer2">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="150" height="150">
<param name="movie" value="fruitdm.swf" />
<param name="quality" value="high" />
<embed src="fruitdm.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="150" height="150"></embed>
</object>
</div>
</div>[/HTML]
i just need to know how to set up the css for the layers inside?
thanks in advance
baz
To get 1000 links to free ad sites visit
http://www.freeaddsgalore.me.uk
For FREE:!:
Reply With Quote  
Join Date: Dec 2004
Posts: 1,590
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: How to have the div layer center on any browser?

  #16  
Nov 2nd, 2006
You don't have to do anything special to any "contained" block-level elements (divs). They will automatically adjust to changes to the containing element. You can't assign an "align" property to a DIV element. There is no such thing in XHTML.
Reply With Quote  
Join Date: Aug 2006
Location: braintree
Posts: 57
Reputation: bazmanblue is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
bazmanblue bazmanblue is offline Offline
Junior Poster in Training

Re: How to have the div layer center on any browser?

  #17  
Nov 2nd, 2006
when i add a layer in the tags it automatically assigns a css style to the individual layer in dreamweaver.
this is how it shows
[HTML]#Layer6 {
position:absolute;
width:501px;
height:417px;
z-index:4;
left: 356px;
top: 183px;
background-color: #FFFFFF;
}[/HTML]
do i delete this or just adjust it?
To get 1000 links to free ad sites visit
http://www.freeaddsgalore.me.uk
For FREE:!:
Reply With Quote  
Join Date: Dec 2004
Posts: 1,590
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: How to have the div layer center on any browser?

  #18  
Nov 2nd, 2006
Sorry, I don't use/know Dreamweaver. I code all my HTML, CSS, and JavaScript in a text editor. Note that the term "layer" refers to an older, proprietary Netscape-only tag/element. There is no such thing as a layer in standard HTML. I recommend you get in the habit of referring to elements by their proper names. We're dealing with DIV elements, not layers.

That aside, yes, the approach I'd take is to delete all CSS and styles until you get to the bare minimum. Then, build back up as needed.
Reply With Quote  
Join Date: Aug 2006
Location: braintree
Posts: 57
Reputation: bazmanblue is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
bazmanblue bazmanblue is offline Offline
Junior Poster in Training

Re: How to have the div layer center on any browser?

  #19  
Nov 2nd, 2006
in css you can assign divs to layers by numbers and is standard xhtml.
To get 1000 links to free ad sites visit
http://www.freeaddsgalore.me.uk
For FREE:!:
Reply With Quote  
Join Date: Aug 2006
Location: braintree
Posts: 57
Reputation: bazmanblue is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
bazmanblue bazmanblue is offline Offline
Junior Poster in Training

Re: How to have the div layer center on any browser?

  #20  
Nov 2nd, 2006
[HTML]<div id="Layer2"></div>[/HTML]
if anyone uses dreamweaver i could sure do with some help?
it works fine if i dont have margin: auto auto but im trying to get all the <div> tags to move in sequence with the browser size.
when i have <div> tags inside each other i cannot work it out
To get 1000 links to free ad sites visit
http://www.freeaddsgalore.me.uk
For FREE:!:
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 5:08 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC