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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS plainly ignoring height attribute

    Hello all,
    I am having a problem with the css height attribute on a table, as you can see by clicking on the following link, it is working on one part of my page but being completely ignored on another.

    <div align="left" style="margin-left: 3px; width:195px; height:400px;"><p>example.com – designer holiday creations.</p>...</div>

    That works, and when there is not enough content to fill the div, this kicks in to make sure it doesn't mess up the display of my table.

    However, this does absolutely nothing:

    <table border=1 style="background-color:#b4c57f; width:150px; height:200px; border-style:solid; border:thin; border-color:#ceb76f;"><tr><td...

    I would really appreciate some ideas, I am stuck. The width attribute does work, the height does nothing. Just search on the text provided when going to view source and you'll find it right away.

    http://www.mychristmastree.com

    Thanks,

    Matthew

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Try

    Code:
    <style type="text/css">
    <!--
    #talldiv {
    	align: left;
    	margin-left: 3px; 
    	width:195px; 
    	height:400px;
    	position: relative;
    	background-color:#000066;
    }
    -->
    </style>
    
    <div id="talldiv"></div>
    Separate CSS from HTML tags to ensure validity as well. And don't use tables for layout, only for displaying table data (I don't know if thats what you were doing with your second part or not..)
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.


  •  

    Posting Permissions

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