CSS - Web Page not filling the total...

User 2746411 Photo


Guest
1 post

Hi everyone, I am David and I am new to the community.
I hope some one can help. I am writing some web pages that all have an external style sheet. The main external css style sheet has the html and body tags set to auto so the pages expand as content fills the page.
I have a few pages that do not have any content and so as a result the web page does not fill the browser. To over come this and to make the web page fill the browser on the web pages that have no content I added some embedded styles for the html and body tags as shown below.
html, body
{
height: 100%;
}
Unfortunately this does not work and the web page is still only rendering half way down the browser window.
If I define a certain height in pixels this does work but I do not want to give the web page a fixed height as I want to view the web page on a mobile device as well a desk top and so the browser height can vary.
Has anyone got any ideas to why my embedded style is not working.
Thanks a lot.
User 187934 Photo


Senior Advisor
20,271 posts
Online Now

Perhaps.
margin: 0;
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 434929 Photo


Ambassador
938 posts

Or maybe

html{
height: 100%;
}
body {
min-height: 100%;
}
Guys at coffeecup are awesometacular.
User 10077 Photo


Senior Advisor
1,096 posts

What about using javascript to get the height of the screen and then applying that height to a transparent image that is used as a placeholder. It's a "duct-tape" approach, but it might work. lol
ASK ME ANYTHING
I provide personalized help for Coffeecup Users including personal or group training for Site Designer, Web Form Builder and more via Zoom.
Email me at support@uscni.org or call 865-687-7698.

Did you know that Web Form Builder can be used for both simple and complicated forms and that it's not limited to the default fonts and buttons? Take a look at a form we developed for WindowTinting.com.
https://forms.windowtinting.com/forms/w … ppingcart/
User 122279 Photo


Senior Advisor
14,648 posts
Online Now

I believe Mansour's approach is easier...
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com



Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.