...

View Full Version : css page size



puja
04-25-2006, 12:58 PM
hi
this is probably very simple for most of you but i seem to be struggling with it.
ive done a css but i dont know how to use it to ensure that all my pages fill the whole screen length wise (i hope that makes sense).
width wise they are all equal but length wise some are shorter than the rest.

this is what it looks like at the moment:

/* Simple style */
body {
margin: 0px;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline ;
}

.page_heading {
color: #FFFFFF;
font-family: "Times New Roman", serif;
font-size: 22pt;
text-align: center;
padding: 5px 0px;
}

span.white a {
color: #FFFFFF;
}

.buttonscontainer {
width: 200px;
}

.buttons a {
color: #000000;
background-color: #6699FF;
padding: 2px;
padding-left: 3px;
display: block;
border-bottom: 1px solid #0066CC;
font: 13px Arial, sans-serif;
font-weight: bold;
text-decoration: none;
text-align: left;
}

.buttons a:hover {background-color: #0066CC;
color: #FFFFFF;
text-decoration: none;
}

its very simple and im just using it to hopefully make the pages the same size and for my menu system.
Thanks

VIPStephan
04-25-2006, 01:16 PM
Plain CSS doesn't say anything without the HTML code it's referring to. Give us a little more to work with please.

If I understood you right, you want your page always extend to the bottom of the screen even if ther's less content?
height: 100%; might do it if you apply it to the body and the html:


html, body {height: 100%}

But you still need it to apply to the content itself which I can't help you without you providing your HTML...

Oh and always use
tags to post your code here (or press the little "#" button in the post window).

BonRouge
04-25-2006, 01:18 PM
CSS is used to style HTML. I have no idea what your page looks like or what your problem is because you've posted no HTML. Some people are mind readers. Some people code web pages. Unfortunately, not many people do both.

puja
04-25-2006, 01:22 PM
lol
ok yeh that is what i want to do.
umm ok this is what my basic html page looks like:

<?php

require_once("config.php");
$connection = @mysql_connect($db_host, $db_user, $db_password) or die("oops! error connecting");
?>
<html>
<head>
<title><?php echo "Search" ?></title>
<head>
<body>

<table border="1" width="100%" height="226">
<tr>
<td width="22%" height="91" bgcolor="#0099FF">&nbsp;</td>
<td width="78%" height="91" bgcolor="#66CCFF" ALIGN=CENTER>&nbsp;

<H1> Search </H1>

</td>
</tr>
<tr>
<td width="22%" height="123" bgcolor="#6699FF">&nbsp;
<div class="buttonscontainer">
<div class="buttons">
<a href="manage_pay.php">Manage Payment</a>
<a href="ownerhomepage.php">Owner Homepage</a>
<a href="logout.php">Logout</a>
</div>
</div>
</td>
<td width="78%" height="123" bgcolor="#99CCFF" ALIGN=CENTER>

<p>&nbsp;</p>
<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>

</form>
</td>



</table>


</body>

</html>

hope thats what u meant..thanks

BonRouge
04-25-2006, 01:25 PM
See if this helps... http://bonrouge.com/3c-hf-fluid-lc.php

puja
04-25-2006, 01:52 PM
hi
i tried doing some stuff from that aswell like adding the #wrap for internet explorer and stuff but it still doesnt work.
do i need to change nething on my html except having the line:

<link rel="stylesheet" type="text/css" href="template2.css">

VIPStephan
04-25-2006, 02:24 PM
Excuse me when I sound a little harsh but: What are you talking about??

[...] adding the #wrap for internet explorer and stuff [...]
The #wrap isn't just for internet explorer or to look good in your HTML... it isn't done by adding something here and there. I guess what BonRouge was implying with his link is to say that you should recode the page from scratch using valid, up-to-date HTML markup and CSS to style the page.

[...] do i need to change nething on my html [...]
Not just anything, almost everything! :rolleyes:


<link rel="stylesheet" type="text/css" href="template2.css">
Where do you have that from? Is that your CSS file? It's not in the HTML you posted...? :confused:

Do you have an image to show us how it should look like in the end?

puja
04-25-2006, 04:22 PM
so ur saying i shud change my whole style sheet?
it works fine at the moment, it just doesnt fill the page 100%.
and i realised that the line i posted wasnt part of my html code which is y i posted it to show how i was linking the two.
they link fine and work fine so what are u suggesting i need to change on my html code?

VIPStephan
04-26-2006, 01:11 AM
What I'm saying is that your HTML code just isn't very good. Using tables to layout a page is outdated and you should aim for tableless code (except you actually have tabular data like sports results or something like that).

It's good that you use CSS but it can't deploy it's full potential with such HTML code. Look at the link BonRouge supplied and find what kind of page layout (2 column/3column....) fits best for you. And then look at the code there and how this is done (completely without tables)

By the way: There is a closing </form> tag in the code you provided but I don't see an opening tag?:confused:

And to remind you: When you provide code the next time here put it in between
tags!

puja
04-26-2006, 11:53 PM
thanks for the advice but im doing this as part of an acedemic project and rather than the layout it it concentrated more on the functionality.
also i dont really have time to change the layout now
thanks anyway for trying 2 help



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum