Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Layout and position problem
Old 09-09-2009, 11:13 PM Layout and position problem
Junior Talker

Posts: 4
Name: mariela
Trades: 0
Hello, as the title indicates i have a problem that i cant resolve and i appreciate if you can help me.

Well, as I want to have a page with 3 different backgrounds y used 2 divs for the first two divs and a background color page for the third. All of them with margin and padding set in 0 so the width can strech 100% the browser.

Then i want all the content centered on those divs. And thatīs the BIG PROBLEM.
I was able to center the logo at the header div and a flash swf (itīs a banner and the menu). Also its remains centered in Iexplorer. But the div that contains the texts and photos it stays at the left. I canīt make it center it.
I am reading a lot of tutorials but i canīt find the answer.

I paste my code here so you can have a clear idea of what i want to do. Also i upload the page: http://www.digital-x.com.ar/HTML/test/testing.html.
Thanks a lot!!!!!!!!!!!


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body{
padding:0;
height:100%;
margin: 0px;
background-color: #FBFAF4;
text-align: center;
min-height:100%;
}


#wrap{
margin: 0 auto;
padding: 0 auto;
width: 100%;
height;
display: inline;
}
#clear {
clear: both;
margin-right: 0px;
margin-bottom: 0px;
height: 4px;
}
#line {
background-image: url(image/bck_lineup.png);
background-position: top;
height: 9px;
}
#bg_header {
background-image: url(image/bck_header.png);
background-repeat: repeat-x;
height: 130px;
margin: 0;
padding: 0;
}

#logo{
height: 80px;
width: 618px;
text-align: center;
position: relative;
margin: auto;
margin-top: 30px;
}
#bg_medio {
background-image: url(image/bck_medio.png);
background-repeat: repeat-x;
height: 209px;
text-align:center;
margin:0;
padding:0;
}
#flash{
text-align: center;
height: 209px;
width: 719px;
position: relative;
display:inline;
}

#footer {
text-align: center;
clear: both;
width: auto;
}
#content {
margin-left: auto;
margin-right: auto;
background-color: #FBFAF4;
text-align: left;
display: block;
height: 200px;
float: left;
}
#box {
width: 719px;
background-color: #F2EFE6;
position: relative;
margin-left: 15px;
}

-->
<!--[if IE]>
.item {
margin-left: 20px;
padding: 0px;
}
<![EndIf] {
-->

</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>

<body>
<div id="wrap">
<div id="bg_header">
<div id="line"></div>
<div id="logo" align="center"><img src="image/logo.png" width="496" height="80" align="middle" /></div>
</div> <!--end wrap-->
<div id="bg_medio">
<div id="menu" align="center"></div>
<div id="flash" align="center">
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','719','heigh t','209','src','image/Movie1','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movi e','image/Movie1' ); //end AC code
</script><noscript><object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="719" height="209">
<param name="movie" value="image/Movie1.swf" />
<param name="quality" value="high" />
<embed src="image/Movie1.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="719" height="209"></embed>
</object>
</noscript></div>
</div>
</div>
<br />
<div id="content">
<div id="box">Content for id "box" Goes He<br />
</div>
</div> <!--end content-->

<div id="footer">footer here</div>
</body>
</html>

Last edited by mapux; 09-09-2009 at 11:18 PM.. Reason: add a link
mapux is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-09-2009, 11:59 PM Re: Layout and position problem
Douglife's Avatar
Extreme Talker

Posts: 218
Name: Douglas Montgomery
Location: Florida
Trades: 0
Here is a quick fix to your issue.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>


<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Untitled Document</title>
<style type="text/css">
<!--
body{
    padding:0;
    height:100%;
    margin: 0px;
    background-color: #FBFAF4;
    text-align: center;
    min-height:100%;
}


#wrap{
    margin: 0 auto;
    padding: 0 auto;
    width: 100%;
    height:auto;
    display: inline;
}
#clear {
    clear: both;
    margin-right: 0px;
    margin-bottom: 0px;
    height: 4px;
}
#line {
    background-image: url(image/bck_lineup.png);
    background-position: top;
    height: 9px;
}
#bg_header {
    background-image: url(image/bck_header.png);
    background-repeat: repeat-x;
    height: 130px;
    margin: 0;
    padding: 0;
}

#logo{
    height: 80px;
    width: 618px;
    text-align: center;
    position: relative;
    margin: auto;
    margin-top: 30px;
}
#bg_medio {
    background-image: url(image/bck_medio.png);
    background-repeat: repeat-x;
    height: 209px;
    text-align:center;
    margin:0;
    padding:0;
}
#flash{
    text-align: center;
    height: 209px;
    width: 719px;
    position: relative;
    display:inline;
}

#footer {
    text-align: center;
    clear: both;
    width: auto;
}
#content {
    margin-left: auto;
    margin-right: auto;
    background-color: #FBFAF4;
    text-align: left;
    display: block;
    height: 100px;
    float: center;
}
#box {
    width: 719px;
    background-color: #F2EFE6;
    position: relative;
    margin-left: 15px;
}

-->
<!--[if IE]>
.item {
margin-left: 20px;
padding: 0px;
}
<![EndIf] {
-->

</style>
<script src="testing_files/AC_RunActiveContent.js" type="text/javascript"></script>
</head><body>
<div id="wrap"> 
  <div id="bg_header">
    <div id="line"></div>
              <div id="logo" align="center"><img src="testing_files/logo.png" width="496" align="middle" height="80"></div>
</div>     <!--end wrap-->
  <div id="bg_medio">
    <div id="menu" align="center"></div>  
    <div id="flash" align="center">
      <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','719','height','209','src','image/Movie1','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','image/Movie1' ); //end AC code
</script><embed src="testing_files/Movie1.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="719" height="209"> <noscript><object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"
width="719" height="209"> <param name="movie" value="image/Movie1.swf"
/> <param name="quality" value="high" /> <embed src="image/Movie1.swf"
quality="high"
pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" width="719" height="209"></embed>
</object> </noscript>
</div>
<br>
   <div id="content" align="center">
<div id="box" align="center" style="left: 302px; top: 3px; width: 705px">Content for  id "box" Goes He<br>
</div>
</div>

<div id="footer">footer here</div>
</body></html>
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Douglife is offline
Reply With Quote
View Public Profile Visit Douglife's homepage!
 
Old 09-10-2009, 12:41 PM Re: Layout and position problem
Junior Talker

Posts: 4
Name: mariela
Trades: 0
thanks for yout help, but with those changes the box div displays on the right instead of doing in the center of the page like the flash movie and the logo.

Is there any technique for making 3 different backgrounds all with auto witdh and height, that have the content centered in the middle of the page?
mapux is offline
Reply With Quote
View Public Profile
 
Old 09-10-2009, 12:53 PM Re: Layout and position problem
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
It would be more helpful to tell the OP just WHAT is needed, and why.

In looking at your code, the problem as I see it is that you are closing your #wrap too soon. Enclose the ENTIRE STRUCTURE inside of #wrap, making the entire site centered along with it.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 09-10-2009, 02:38 PM Re: Layout and position problem
Junior Talker

Posts: 4
Name: mariela
Trades: 0
thanks!!, i will try what you told me.

Hours ago i was trying to make it work and I used one single image fot the background page with repeat-x and for the blank space that appeared in the bottom, i set the same color of the third one for the entire page.
Then i place all divs in a wrap and centered it all, and is working now!. I think its the easy way to do it.

But I still have the doubt about if it posible make a page with 3 different backgrounds using 3 different divs that contains those backgrounds and then center the content inside it.

I think the image that i made will explain it better than my words! http://www.digital-x.com.ar/HTML/test/example.jpg

For example, having one image for the background makes that i canīt expand the height when i add more content. So i thought making 3 divs each one with one background and then place the content there.

If you noticed iīm new in css and i have a lot of doubts
Thanks for your help
mapux is offline
Reply With Quote
View Public Profile
 
Old 09-10-2009, 03:32 PM Re: Layout and position problem
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Quote:
But I still have the doubt about if it posible make a page with 3 different backgrounds using 3 different divs that contains those backgrounds and then center the content inside it.
Yes, you can do that. Based on that example, what you're showing there is not all that difficult to do, especially if you're dealing with solid colors.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 09-11-2009, 07:03 PM Re: Layout and position problem
Junior Talker

Posts: 4
Name: mariela
Trades: 0
Ok, thanks very much! iīll keep practicing : )
mapux is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Layout and position problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.25779 seconds with 12 queries