473,396 Members | 1,871 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,396 software developers and data experts.

page height

pradeepjain
563 512MB
Hello guys,
I am working on a site where in i have a container of width 90% within which all header footer and content area comes.I have a small problem with footer that is when i have content more the footer goes down which is ok.but when i have very small content say 5 lines the footer comes up this is the main problem.when the content is less then a page height i want the footer to be at the bottom of the page..is there any way to do this .say some min-height or something like that.


Thanks,
Pradeep
Sep 1 '08 #1
10 4250
Dormilich
8,658 Expert Mod 8TB
is there any way to do this .say some min-height or something like that.
there's the min-height css property (though IE < 7 fails there). values may be of length or percentage.
Sep 1 '08 #2
pradeepjain
563 512MB
there's the min-height css property (though IE < 7 fails there). values may be of length or percentage.

i am not able to set in percentages ..i want to set in % bcos to support all browsers..how to do it
Sep 1 '08 #3
Dormilich
8,658 Expert Mod 8TB
% - Defines the minimum height for the element in % of the containing block
for min-height to work with % you need a container element (e.g. body) from which the min-height is calculated (but obviously you need a numeric value to set the containers height itself). So you can't stretch a %-defined element over the parent element's border (you also can't stretch the parent itself, resp.)

note: same goes for height
Sep 1 '08 #4
pradeepjain
563 512MB
for min-height to work with % you need a container element (e.g. body) from which the min-height is calculated (but obviously you need a numeric value to set the containers height itself). So you can't stretch a %-defined element over the parent element's border (you also can't stretch the parent itself, resp.)

note: same goes for height
i have 2 elements body and container which is inside body where all data comes......
Sep 1 '08 #5
Dormilich
8,658 Expert Mod 8TB
i have 2 elements body and container which is inside body where all data comes......
your problem (as I understand) was that you want the footer at the bottom of the page even when there's hardly any content. To accomplish that you have to stretch the body all the way down, but the body only wraps around the existing text/content (if no numeric height is set). Unfortunately you can't do that with percentage height (because then you need a wrapper element of defined (numeric) height).
The only solution for this I know is to determine the inner height of the browser window and assign that value to body/the container. You also may use absolute positioning (you must take care when to switch back to normal, otherwise the footer will sit over your content).

to show where body and the container end, temporarly assign a border to both and experiment with numeric/percentage (min-)heights

hope that is of more help
Sep 1 '08 #6
David Laakso
397 Expert 256MB
Have you tried "footerStickAlt" ?
footerStickAlt
Sep 1 '08 #7
pradeepjain
563 512MB
Guys i am not really able to achieve what i need..the layout that i am using is

http://www.cssplay.co.uk/layouts/3cols.html


so if u can show me what i need to add in css and where i will be great full.bcos once i see some example i wll be able to understand better.
Sep 2 '08 #8
Dormilich
8,658 Expert Mod 8TB
I'd say, just add the rules according to the given example.
or applied to the example of your link:
- copy the css rules
- rename #nonFooter to #container
- rename #content to #inner
- put everything between the closing #container div tag and the closing body tag in one div and rename #footer it to it
- adjust padding and margin to your needs

regards
Sep 2 '08 #9
pradeepjain
563 512MB
hey guys i used this

http://bonrouge.com/hcf-fluid.php
for my problem..its working but some small problems plzz help me out.

I am posting my css and html code'
this is css

Expand|Select|Wrap|Line Numbers
  1. html {height:100%;}
  2. body {
  3. margin:0;
  4. padding:0;
  5. height:100%;
  6. background-color:orange;
  7. }
  8. #wrap {
  9. width:90%;
  10. margin-left:auto;
  11. margin-right:auto;
  12. min-height:100%;
  13. position:relative;
  14. border:1px solid silver;
  15. padding-left:1px;
  16. padding-right:1px;
  17. }
  18. * html #wrap {height:100%}
  19. #inner-wrap {
  20. background-color: blue;
  21. padding-bottom:80px;
  22. }
  23. #inner-wrap:after {
  24. content:" ";
  25. display:block;
  26. clear:both;
  27. }
  28. * html #inner-wrap {
  29. height:1px;
  30. }
  31. #footer {
  32. position:absolute;
  33. bottom:0;
  34. height:80px;
  35. background-color: #333333;
  36. width:100%;
  37. padding:-10px;
  38. }
  39. #header {
  40. height:80px;
  41. background-color: #333333;
  42. }
  43.  
  44.  

this is html

[HTML]<html>
<head>
<link rel="stylesheet" type="text/css" href="style1.css" />
<body>
<div id="wrap">
<div id="header">Header</div>
<div id="inner-wrap">
<div id="content">Content</div>
</div>
<div id="footer">Footer</div> </div>
</body>
</html>[/HTML]


wht the problem is that the blank portion where no content is there i.e the gap b/w the content and footer is taking the color of the body..how to make it not take the color.and yeah in the bottom of the page in the footer its not showing the right side border as its stretching full width .plzz have a look at code and tell wht changes shld be made.

and ya i did not understand the need for padding-bottom:80px in #inner-wrap should the padding set as the height of the footer and also the need for #inner-wrap:after



thanks,
Pradeep
Sep 2 '08 #10
David Laakso
397 Expert 256MB
wht the problem is that the blank portion where no content is there i.e the gap b/w the content and footer is taking the color of the body..how to make it not take the color.and yeah in the bottom of the page in the footer its not showing the right side border as its stretching full width .plzz have a look at code and tell wht changes shld be made.

and ya i did not understand the need for padding-bottom:80px in #inner-wrap should the padding set as the height of the footer and also the need for #inner-wrap:after
Huh? No clue. Nevertheless, try:
Expand|Select|Wrap|Line Numbers
  1. #wrap {background: blue;} <-------------- :: add
  2. #footer {
  3. width : 100%;<--------------------------- :: add
  4. padding: 10px;<-------------------------- :: delete
  5. padding: 10px 0;<-------------------------- :: add
  6. }
  7.  
  8.  
Sep 2 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Goober | last post by:
I have the following default.aspx page that works properly. However, what I want to do is to link the graphics within it (that are hard coded now in the default web page) to our corporate...
2
by: VB Programmer | last post by:
I only have 1 set of <FORM> tags in my HTML file, but I keep getting this error. Any ideas? *********** A page can have only one server-side Form tag. Description: An unhandled exception...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
7
by: GaryDean | last post by:
In my old 1.1 apps the default was MS_POSITIONING="GridLayout" and Textboxes and labels and such always had POSITION: absolute; and I never had any distortion when the page was rendered. Life was...
13
by: Greg | last post by:
Most suggestions on this topic recommend to use a page footer and make it visible only on the last page. My problem is that the footer is half of the height of a page which means the detail would...
1
by: rsteph | last post by:
I've got some product information pages, with images and text, all setup within a table. I'm trying to add a small image in the upper right hand corner of the content div (where all the important...
4
osward
by: osward | last post by:
I had made a table colum sortable and paging the table, following are the code // Display Event List echo "<center>"._EVENTLIST."</center><br>"; $now = Date(Y-m-d); // sort table...
1
by: soluvah | last post by:
Hello Folks, Been trying to widen my site's body from "779" to "1000" so it almost fills the window. IE 7 on windows XP just dismantles the pages and leaves wide gaps between the left column and...
7
by: imtmub | last post by:
I have a page, Head tag Contains many Scripts and style sheet for Menu and Page. This code working fine and displaying menus and page as i wanted. Check this page for reference....
3
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.