Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS malfunction - or user error?

    I've got an external file, with css in it that looks like this:

    <style type="text/css">
    table {width:750px; height: 1000px; border-width: 1px;}
    .header {height:120px;}
    .spacer {height:10px; background-color:#000000;}
    .menu {width:300px; }
    .sidebar {width:150px; }
    </style>

    the html looks like this:

    <html>
    <head>
    <title>sample site</title>
    <LINK REL=StyleSheet HREF="style.css" TYPE="text/css">
    </head>
    <body topmargin="0" leftmargin="0"><center>
    <table>
    <tr><td class="header" colspan="3"><h1>Amateur Theology...Banner/logo</h1></td></tr>
    <tr><td class="spacer" colspan="3">&nbsp;</td></tr>
    <tr><td class="menu"><v align="center">
    example
    </td>
    <td><iframe src="home.html" name="content" width="100%" Height="100%" border="0" scrolling="no"></iframe>
    </td>
    <td class="sidebar"><p align="right">Random schtuff, possibly ads</td>
    </tr>
    <tr><td class="footer" colspan="3"><h5>Cool footer thing/(c) info</h5></td></tr>
    </table>
    </body>
    </html>


    for some reason the css seems to not be affecting the size of the table, no matter what i change it to, the table size remains the same! (height & width)

    can someone please help?

    i want the width to be: 75% and height 100% but i cant get it to work!

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Style

    First of all, an external style sheet shoud not contain a style element; only the style rules themselves.

    Second, while you say you want the table width and height in percentages, you've specified absolute pixel values (750px = 750 pixels).

    Third, while a 75% width shouldn't be a problem, a 100% height only works if both the html and the body element are set to 100% height as well, and even then it's a guess.

    Last, you seem to misuse table markup for layout purposes; proper, fitting markup combined with CSS for presentational and layout purposes offer more possibilities for styling and more flexibility.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #3
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank you! that helped.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •