473,413 Members | 2,066 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Stretch DIV Tag From Middle?

I have a DIV specified like this:

#divStretchArea
{
padding: 0px ;
margin : 0px ;
border: 1px #0C96C3 solid ;
position : absolute ;
overflow-x : auto ;
overflow-y : none ;
width: 70% ;
height: 70% ;
left: 317px ;
top: 70px ;
}

So it sits kind of in the middle of the page. The area takes up some of
the screen, but I want the right edge to be as close to the right edge
of the web page as possible (it's not when I maximize the page), and
the bottom edge to be as close to the bottom as possible minus 100
pixels.

Thanks.

Jul 23 '05 #1
8 6195
me
<br************@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I have a DIV specified like this:

#divStretchArea
{
padding: 0px ;
margin : 0px ;
border: 1px #0C96C3 solid ;
position : absolute ;
overflow-x : auto ;
overflow-y : none ;
width: 70% ;
height: 70% ;
left: 317px ;
top: 70px ;
}

So it sits kind of in the middle of the page. The area takes up some of
the screen, but I want the right edge to be as close to the right edge
of the web page as possible (it's not when I maximize the page), and
the bottom edge to be as close to the bottom as possible minus 100
pixels.

Thanks.


Which browser?
Signed,
me
Jul 23 '05 #2

Browser is IE6 on WinXP-SP1.

Thanks.

Jul 23 '05 #3
me
<br************@hotmail.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...

Browser is IE6 on WinXP-SP1.

Thanks.


Here's the best solution I could come up with, use it in good health.
Good Luck,
me

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
..divstretch { border: 1px #0C96C3 solid; float: left; border-color: #0C96C3
#0C96C3; left: 30%; top: 20%; clip: rect( ); overflow: auto}
body { margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left:
0px}
-->
</style>
</head>

<body bgcolor="#FFFFFF">
<div id="content" style="position:relative; width:70%; height:70%;
z-index:2; visibility: visible; left: ; top: " class="divstretch">
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
</div>
</body>
</html>
Jul 23 '05 #4
me wrote:

Here's the best solution I could come up with, use it in good health.
Did you come up with this all by yourself? Looks suspiciously like some
tool-generated crap.
<style type="text/css">
<!--
Cargo cult. Putting an embedded stylesheet within html comments hasn't
been needed since some version of Netscape 2 (or was it NS1?).
.divstretch { border: 1px #0C96C3 solid; float: left; border-color: #0C96C3
#0C96C3; left: 30%; top: 20%; clip: rect( ); overflow: auto}
- What's the point of setting both border shorthand and separate
border-color when they use the same values?
- What's the point of setting empty clip property? It's invalid, anyway.
If you ever validated your code you'd know this right away.
- Left and top properties have no relevance on non-positioned elements,
which include floats.
- Overflow has no relevance without explicit dimensions.
body { margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left:
0px}
Bloatware. margin:0 is all you need.
<div id="content" style="position:relative; width:70%; height:70%;
z-index:2; visibility: visible; left: ; top: " class="divstretch">


Invalid left/top values, unnecessary visibility property. You've also
created a big inconsistency between the inline styles and the class
rules. Is this element supposed to float or be positioned? Or are you
just hacking away until something seems to come out right in WinIE?

Besides, inline styles are almost never a good idea. All those
properties should be part of either the #content or the .divstretch
rules. You're creating a maintenance PITA when you put style rules all
over the place like this.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 23 '05 #5
me
"kchayka" <us****@c-net.us> wrote in message
news:3a*************@individual.net...
me wrote:

Here's the best solution I could come up with, use it in good health.
Did you come up with this all by yourself?


Yes, in a manner of speaking.
Looks suspiciously like some
tool-generated crap.
I used Dreamweaver (albeit an older version) the industry standard for
professional website designers, at least that's what Macromedia says,
possibly you've heard of them, they're the creators of Shockwave, Flash,
Freehand, etc etc etc.
<style type="text/css">
<!--


Cargo cult. Putting an embedded stylesheet within html comments hasn't
been needed since some version of Netscape 2 (or was it NS1?).


Possibly, but it still works and it facilitates pasting an entire web page
with styles into a NG post.
.divstretch { border: 1px #0C96C3 solid; float: left; border-color: #0C96C3 #0C96C3; left: 30%; top: 20%; clip: rect( ); overflow: auto}


- What's the point of setting both border shorthand and separate
border-color when they use the same values?
- What's the point of setting empty clip property? It's invalid, anyway.
If you ever validated your code you'd know this right away.


You may well be right, I'm sure I couldn't say. I concern myself with what
works in IE not with what validates.
- Left and top properties have no relevance on non-positioned elements,
which include floats.
They do if they relate to the parent, in this case the body (at least in
IE).
- Overflow has no relevance without explicit dimensions.
But there are dimensions, they're a percentage of the body. I used an
overflow setting of auto so IE would only create a vertical scrollbar. IIRC
setting overflow X to auto and overflow Y to none would still be the same
thing, at least in IE.
body { margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px}


Bloatware. margin:0 is all you need.


Indeed, how many extra kilobytes do you suppose it adds?
<div id="content" style="position:relative; width:70%; height:70%;
z-index:2; visibility: visible; left: ; top: " class="divstretch">


Invalid left/top values, unnecessary visibility property. You've also
created a big inconsistency between the inline styles and the class
rules. Is this element supposed to float or be positioned? Or are you
just hacking away until something seems to come out right in WinIE?


You got me there, but as you so astutely observed it does work in IE. Thank
you.
Besides, inline styles are almost never a good idea. All those
properties should be part of either the #content or the .divstretch
rules.
Possibly, I'm just a simple guy doing the best I can with what I've got.
You're creating a maintenance PITA when you put style rules all
over the place like this.


That depends on how you define maintainance. We're building websites not
houses. I don't have any trouble determining what styles are applied where.

IMO you omitted two critical points, you failed to prove that what I did
doesn't work in IE (possibly because it does work) and you failed to offer
the OP a working solution.
Signed,
me
Jul 23 '05 #6
me wrote:
"kchayka" <us****@c-net.us> wrote in message
news:3a*************@individual.net...

Looks suspiciously like some
tool-generated crap.
I used Dreamweaver


I should have guessed. Nobody who hand codes would have come up with
some of that crap.
IMO you omitted two critical points, you failed to prove that what I did
doesn't work in IE (possibly because it does work) and you failed to offer
the OP a working solution.


But I think I made the point that you don't care much about quality, eh?
;) That's what I was really shooting for.

BTW, I could care less about a solution that only works in IE, since I
would rather create something that works in a WWW context, not just in a
MS environment. It's people like you who can make the web a crappy place
to be for us non-IE users. And there's absolutely no reason for you to
make it this way, either.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 23 '05 #7
me
"kchayka" <us****@c-net.us> wrote in message
news:3a*************@individual.net...
me wrote:
"kchayka" <us****@c-net.us> wrote in message
news:3a*************@individual.net...

Looks suspiciously like some
tool-generated crap.
I used Dreamweaver


I should have guessed. Nobody who hand codes would have come up with
some of that crap.


Then blame Macromedia. IMO it's not profitable to hand code but YMMV and it
almost certainly does.
IMO you omitted two critical points, you failed to prove that what I did
doesn't work in IE (possibly because it does work) and you failed to offer the OP a working solution.


But I think I made the point that you don't care much about quality, eh?
;) That's what I was really shooting for.


A quality answer must first satisfy the OP's needs, if it fails on that
count then it fails completely.
BTW, I could care less about a solution that only works in IE,...
No doubt but the OP does, remember him? And who said it *only works in IE*
(somone please correct me if I'm wrong)? See above anyway.
...since I
would rather create something that works in a WWW context, not just in a
MS environment.
But the web is an MS enviorment for IE users (sort of).
It's people like you who can make the web a crappy place
to be for us .
I can't fathom your definition of "crappy" for non-IE users. AFAICT the
solution I offered the OP won't cause a fatal error in any browser on any
OS.
And there's absolutely no reason for you to
make it this way, either.


I hate to bother you with niggling details but nothing else will achieve the
OP's goal in IE.

I still don't see a working solution for the OP's request in any of your
posts. Are you done now?
Signed,
me
Jul 23 '05 #8
me wrote:

[snip drivel]

I should learn to stop feeding trolls.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 24 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: susibabe | last post by:
I have a website that I am working on the layout.... www.sngao.com/Joomla I tried to use a table with four rows, * 1st row - banner * 2nd row - also banner image * 3nd row - has...
1
by: Ufit | last post by:
I have a problem with displaying controls in placeholder that in turn is place in the mid cell of the table. When I run IE the table doesn't stretch properly even if I set width and ht to 100% Now...
3
by: pavel.orehov | last post by:
Hi, Does anybody knows how to stretch Bitmap in C#. Bitmap b = Bitmap.FromFile("..."); // stretch code ??? Thanks,
5
by: Saabster | last post by:
Hi all, It's always the simple stuff that trips you up I guess. Here is the issue I'm dealing with. I have a folder with 1400 excel files that I need to move to another location. Since each...
6
by: yuiness | last post by:
I have this CSS layout that I'd like to use for a personal site: I want the layout to stretch all the way from the top of the page to the bottom of the page regardless of how little content...
1
by: dutchguy | last post by:
Hi there. I've searched the forum but could find what I was looking for. I have a tree column site. The 3 columns are in an outer div. I would like that the outer div (and the other 2 divs) to...
1
by: mactelesis | last post by:
I have searched for "vertical stretch, align, etc." and have tried (and failed) with all of the solutions to stretch the "#nav vertical" div so that it streches to the height of the page. As you can...
3
by: Harris Kosmidhs | last post by:
Hello. I see there is a W3C CSS2 specification for font-stretch property. I also see that no browser supports it. Why is that? And is there a work around for this? I don't want to use an image...
4
by: Bob Altman | last post by:
Hi all, I posted an earlier question to the microsoft.public.inetserver.asp.general newsgroup asking how to set the background of a client-side table cell to a gradient, and I received this...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.