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
Div starts 300px in from left, But fills to 100% minus 2px on the right.
Old 09-23-2009, 08:45 AM Div starts 300px in from left, But fills to 100% minus 2px on the right.
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,615
Location: UK
Trades: 1
Hi Guys.

How can i do this:

I have a div that starts 300px in from the left.

I then want the div to be 100% wide ( to the right ) then -2px in from the right.

Does this make sense?

How can i achieve this.
If i make the div 100% it makes it 100% of the page size, so it goes off the page to the right by 300px.


Any thoughts?

Thanks
G
__________________

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

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


lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
 
Register now for full access!
Old 09-23-2009, 08:48 AM Re: Div starts 300px in from left, But fills to 100% minus 2px on the right.
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,615
Location: UK
Trades: 1
OK ive figured the above out, However.
if i set bottom:2px ( so the div goes down to 2px from the bottom ) it works in FF but doesnt in IE.

IE doesnt seem to understand the bottom att.


TY yall
__________________

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

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



Last edited by lynxus; 09-23-2009 at 09:10 AM..
lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Old 09-23-2009, 10:03 AM Re: Div starts 300px in from left, But fills to 100% minus 2px on the right.
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
Quote:
bottom:2px
Is this a margin or padding? Are you using absolute positioning?

We need to see some CSS and see if you are enclosing this div in a parent div, etc.
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 09-23-2009, 11:00 AM Re: Div starts 300px in from left, But fills to 100% minus 2px on the right.
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,615
Location: UK
Trades: 1
THis is what its configured as:

Its not inside any other divs.
<div id="sessions" style="position:absolute; top:85px; left:300px; right:2px; bottom:3px; border:1px solid #666;"></div>

If i use height of 100% it overflows the page by 85px ( from the top attribute )

What im trying to do is have a div thats 300px in 85px down and then the left and bottom of the div need to be 2px from the left and 2px from the bottom.

if that makes sense?
__________________

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

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


lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Old 09-23-2009, 02:10 PM Re: Div starts 300px in from left, But fills to 100% minus 2px on the right.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Use a floated "filler" element and padding.

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Offset</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
html, body {
	height:100%;
}
body {
	padding:0 2px 2px 0;
}
#left_fill {
	width:300px;
	height:100%;
	float:left;
}
#content {
	height:100%;
	position:relative;
	margin: 85px 0 0 0;
}
</style>
</head>

<body>
<div id="left_fill"></div>
<div id="content">Content goes here </div>
</body>
</html>
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-23-2009, 03:54 PM Re: Div starts 300px in from left, But fills to 100% minus 2px on the right.
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Quote:
IE doesnt seem to understand the bottom att.
It most certainly does. However, IE6 & 7 have issues with positioning, so it depends on what the rest of your code is.
__________________
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
 
Reply     « Reply to Div starts 300px in from left, But fills to 100% minus 2px on the right.
 

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.25991 seconds with 12 queries