473,796 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6212
me
<br************ @hotmail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.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******** *************@l 41g2000cwc.goog legroups.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>Untitl ed 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="#FFFFF F">
<div id="content" style="position :relative; width:70%; height:70%;
z-index:2; visibility: visible; left: ; top: " class="divstret ch">
<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="divstret ch">


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******** *****@individua l.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="divstret ch">


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******** *****@individua l.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******** *****@individua l.net...
me wrote:
"kchayka" <us****@c-net.us> wrote in message
news:3a******** *****@individua l.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
19243
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 three cells, one left frame image that stretched to full length of the table, one content cell, and one on the right side has a nested table with 5 navigation buttons and some images for spacing and **i made a background image for the listing titles...
1
1481
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 is even worse - the controls won't show up again on screen. Is there a way to make the view stretch all the forms (master page) correctly? Thanks Uf
3
11219
by: pavel.orehov | last post by:
Hi, Does anybody knows how to stretch Bitmap in C#. Bitmap b = Bitmap.FromFile("..."); // stretch code ??? Thanks,
5
3265
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 file has to go in to a particular target folder I decided that writing a program to move the files is they way to go. I've got all but this last piece down. and for the life of me I can't
6
9500
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 there is, or what screen resolution the user is viewing the site with. If the content won't fit on one screen, I would obviously also want the layout to stretch to accomodate the text. However, I can't seem to figure out a way to get it to do what I...
1
2295
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 stretch with the content of the highest div. I saw some examples to get a 100% height by adding 100% to the body,html but that isn't what i want. I just want the div's in the outer div to stretch with the (variable)height of the highest div. Can...
1
3124
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 see I simply set it to "height:800px;" - which looks bad on really short pages (http://www.coloradopedia.com/~newports/HoursOfOperation.html ) or really long ones (http://www.coloradopedia.com/~newports/BoardOfDirectors.html Please help - on...
3
3970
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 for such a job if it's possible. Thanks
4
5748
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 answer: How do I stretch the static image? The Style property builder for a table cell lets me specify the background image location, tiling, scrolling, and position. But I can't find any obvious way to tell it to stretch the image
0
9673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9525
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10221
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10169
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6785
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.