It is currently Thu Mar 28, 2024 8:48 am


All times are UTC


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: CSS Height
PostPosted: Thu Dec 06, 2007 7:58 pm 
Newbie
Newbie

Joined: Thu Dec 06, 2007 7:39 pm
Posts: 3
Hello everybody. I'm not a total newbie to html and css, but then again, I'm not a techo geek either. I'm looking for a way to have css recognize the height attribute as a percentage. Width works fine as a percentage, however I can't figure out how to get height to work (height: 100%;). Not sure about other browsers, but it doesn't work in Firefox or IE 7. This has baffled me for quite some time. Works in tables, but I don't want tables. Is there some kind of java script that does this? And would it need to be applied to each div tag where I want the height to be a percentage? Sorry if this sounds total newbie-ish and redundant, but hey, how can one learn if they don't ask questions. Thanks

Scott


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 11, 2007 7:17 am 
Newbie
Newbie

Joined: Thu Dec 06, 2007 7:39 pm
Posts: 3
Dynamic Drive has a javascript file for equal height columns in CSS. Too bad it doesn't really work well in IE7, but then if it did, well, I think the world would stand still.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 12, 2008 1:25 pm 
Newbie
Newbie

Joined: Fri Oct 26, 2007 8:00 pm
Posts: 26
you need it like this width="100" height="100" with quotations around it. Works for me! First do the width and then the height in that order.

_________________
I am I will I create


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 31, 2008 2:18 pm 
Newbie
Newbie

Joined: Sat Mar 10, 2007 10:57 am
Posts: 7
Location: Birmingham UK
Code:
<html>
<head>
<style type="text/css">
#mydiv{width:100%;background-color:#F5F5F5}
</style>
<script type="text/javascript">
function setHeight(){
document.getElementById('mydiv').style.height=screen.height-200;
}
</script>
</head>
<body onload="setHeight()">
<div id="mydiv" style="height:100px">test</div>
</body>
</html>


this script fixes the screen height at 200px less than 100% of my desktop's screen height. this allows for toolbars, tabs and the likes

works fine in firefox but in IE7 i get a popup blocker asking if i want to allow the active content :lol:

_________________
Birmingham


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ]  Moderators: Moderators, Support Team

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Hosting | Domains | Servers | Extras | Order | Support | Contacts | FreeHostia © 2011