Web Layout
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsWeb DesignWeb Layout

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 9th, 2006, 08:29 AM
seanl76 seanl76 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 8 seanl76 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 39 m 48 sec
Reputation Power: 0
Master pages and DIV width problem

Hi,
I'm having a problem where in a master page my layout is something like

<div id=header style=height=100px>
</div>
<div style=position:absolute;width=250px;top:100px>
</div>
<div style=position:absolute;left:250px;width=250px;top :100px>
<asp:contentPlaceholder></asp:contentPlaceholder>
</div>


And in a webpage that uses the above master page, i have a
<div id=main style=width:100%>
</div>

As a result the width of div#main is actually 100%+250px.

This problem happens in IE but not firefox.

Does anyone know of a workaround for this problem? It's been frustrating me for the last 2 days.

Cheers,
Sean

Reply With Quote
  #2  
Old July 9th, 2006, 08:36 AM
seanl76 seanl76 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 8 seanl76 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 39 m 48 sec
Reputation Power: 0
O, the other thing is that is there a solution without employing the use of tables as I just want to use DIVs for my layouts.

Reply With Quote
  #3  
Old July 10th, 2006, 03:55 PM
banker's Avatar
banker banker is offline
Charging Rhino Wizard
ASP Free Regular (2000 - 2499 posts)
 
Join Date: Dec 2004
Location: 127.0.0.1
Posts: 2,053 banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 5 Days 23 h 28 m 28 sec
Reputation Power: 36
I'm surprised any of your styles are rendered.
html Code:
Original - html Code
     <div id="header" style="height: 100px;">  </div>  <div style="position:absolute; width: 250px; top:100px;">  </div>  <div style="position:absolute; left: 250px; width: 250px; top: 100px;">  <asp:contentPlaceholder></asp:contentPlaceholder>  </div>


See if that helps.
__________________
ShepherdWeb :: Charging Rhino Wizard

I know of no more encouraging fact than the unquestionable ability of man to elevate his life by conscious endeavor.
{Henry David Thoreau}

§ shepherdweb.com
§ fariswheel productions
§ reagan administration

Reply With Quote
  #4  
Old July 10th, 2006, 03:56 PM
banker's Avatar
banker banker is offline
Charging Rhino Wizard
ASP Free Regular (2000 - 2499 posts)
 
Join Date: Dec 2004
Location: 127.0.0.1
Posts: 2,053 banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 5 Days 23 h 28 m 28 sec
Reputation Power: 36
by the way, div elements are rendered as width: 100% by default.

Reply With Quote
  #5  
Old July 12th, 2006, 09:12 AM
seanl76 seanl76 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 8 seanl76 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 39 m 48 sec
Reputation Power: 0
Thanks for the reply. Ok, oops about the '=' but was a typo on my side. The problem I'm trying to fix is the 100%+250px width in the content pages.
To recreate this problem, create a master page, eg. test.master
with

<div id=header style=height:100px>
</div>
<div style=position:absolute;width:250px;top:100px>
</div>
<div style=position:absolute;left:250px;width:250px;top :100px>
<asp:contentPlaceholder></asp:contentPlaceholder>
</div>

Then Default.aspx with test.master as the master page and

<div id=main style=width:100%>
<table width=100% style=bgcolor:#eeeeee>
<tr><td>hi</td></td>
</table>
</div>


and you'll see what i mean.

(I'm assuming here you know how to create a master page and referencing a master page from a webform)

Reply With Quote
  #6  
Old July 12th, 2006, 09:23 AM
banker's Avatar
banker banker is offline
Charging Rhino Wizard
ASP Free Regular (2000 - 2499 posts)
 
Join Date: Dec 2004
Location: 127.0.0.1
Posts: 2,053 banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 5 Days 23 h 28 m 28 sec
Reputation Power: 36
Do you also have a stylesheet? Margin and Padding can add width to a div element.

Try removing width: 100% from your div, it shouldn't be necessary.

Another consideration is this: You've used position: absolute on all your containers in the masterpage. I haven't had good luck with this producing consistent results. You might try getting your container divs into position using the normal flow instead of absolute positioning.

Final consideration: Use IE Conditional Comments to write CSS styles specifically for IE.

I hope this helps!

Reply With Quote
Reply

Viewing: ASP Free ForumsWeb DesignWeb Layout > Master pages and DIV width problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT