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 Coder
    Join Date
    Sep 2011
    Posts
    61
    Thanks
    9
    Thanked 1 Time in 1 Post

    IE Hack for sizing elements with position

    Solution: Set a doctype (XHTML 1.0 Strict works for sure)

    I am working up a fine little website.
    The layout is not using the documents actual flow, but is just positioning the different elements from the CSS.
    Here's an example:
    Code:
    <div id="content" class="flexcroll"><h1>Testing header</h1>Lorem ipsum dolor sit amet</div>
    Code:
    #content{
    	padding:10px 10px 10px 10px;
    	border:1px solid #000;
    	position:absolute;
    	height:auto;
    	width:auto;
    	left:250px;
    	right:15px;
    	top:110px;
    	bottom:30px;
    	background:url(images/panebg.png) repeat;
    	overflow:scroll;
    }
    Of course Internet Explorer is stubborn as always, and decides not to size the elements when both a left AND right position is given. What can I do here to make it all look as it should?
    Take a look here if you want to see how it looks in the different browsers:
    http://browsershots.org/http://zeroyear.net/skoleside/
    Last edited by Time Sheep; 02-15-2012 at 12:29 PM. Reason: Solved
    Need help?
    I work with the following languages:
    HTML: Professional - PHP: Professional - Visual C#: Average - CSS: Average - ASP: Please don't hurt me! ;(
    Currently practicing: Visual C#

  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,949
    Thanks
    9
    Thanked 724 Times in 718 Posts
    You need a doctype. IE will not behave without one. Try that for starters.

  • Users who have thanked SB65 for this post:

    Time Sheep (02-15-2012)

  • #3
    New Coder
    Join Date
    Sep 2011
    Posts
    61
    Thanks
    9
    Thanked 1 Time in 1 Post
    I did not include that? -.-
    Must've forgotten. It works after setting the doctype to XHTML 1.0 Strict. Thanks
    Need help?
    I work with the following languages:
    HTML: Professional - PHP: Professional - Visual C#: Average - CSS: Average - ASP: Please don't hurt me! ;(
    Currently practicing: Visual C#


  •  

    Posting Permissions

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