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 4 of 4
  1. #1
    New Coder
    Join Date
    Dec 2011
    Posts
    35
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Problems with bullets inside a div

    Cant solve this one by my own.
    It looks like it shuld with IE 8/9, but with 6/7 the bullets are way of to the left. See picture



    I know, it aint many that run IE 6/7 anymore, but there's still some

    Code from site.css
    PHP Code:
    div.info ul li {
          list-
    style-typenone;
          
    background-imageurl('/images/bullet.jpg');
          
    background-repeatno-repeat;
          
    background-position0px 15%;
          
    height30px;
          
    line-height1em;
          
    padding-left8px;
          
    padding-right20px;
    }

    div.info {
          
    width350px;
        
    height115px;
        
    margin-left70px;

    Code from php
    PHP Code:
    <p>
    <
    strong>President:</strong> <a href="mailto:xxx">John doe</a>
    <
    br>
    <
    img src="/images/pic.jpg" width="100" height="100" align="left" /><div class="info"><ul><li><strong>City:</strong></li><li><strong>Age:</strong></li><li><strong>Group:</strong></li></ul></div>
    <
    p
    Any suggestion what to do?

  • #2
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    did you reset your default margins and paddings?

    Code:
    * {
       margin: 0;
       padding: 0;
    }
    after that, put the image within the .info as shown below, you may also want to take out margin-left: ; from .info.

    Last edited by Sammy12; 02-08-2012 at 12:14 AM.

  • #3
    New Coder
    Join Date
    Dec 2011
    Posts
    35
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Thanks for reply.
    If i put the image within the .info as you said the bullets ends up insude the image. That why i placed the image before.
    I've tried everything to make some distance between the image and bullets, but they are stuck where they are now

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,688
    Thanks
    22
    Thanked 1,829 Times in 1,813 Posts
    Hello Injen,
    Look what happens if you float your image and margin your ul over -
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    html, body {
    	margin: 0;
    	background: #fc6;
    }
    #container {
    	width: 760px;
    	margin: 30px auto;
    	padding: 20px 20px 300px;
    	background: #999;
    	overflow: auto;
    }
    .info {
    	width: 350px;
    	overflow: auto;
    	background: #ccc;
    }
    .info img {
    	float: left;
    	display: block; 
    	background: #f00;
    }
    .info ul {
    	margin: 0 0 0 100px;
    	padding: 0 0 0 20px;
    }
    .info ul li {
    	height: 30px;
    	line-height: 1em;
    
    }
    </style>
    </head>
    <body>
        <div id="container">
            <p> <strong>President:</strong> <a href="mailto:xxx">John doe</a> </p>
                <div class="info">
                		<img src="/images/pic.jpg" width="100" height="100" alt="description" />
                    <ul>
                        <li><strong>City:</strong></li>
                        <li><strong>Age:</strong></li>
                        <li><strong>Group:</strong></li>
                    </ul>
                <!--end .info--></div>    
        <!--end container--></div>
    </body>
    </html>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

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