htmlcssweb960.gs

960.gs li tags will not spread out across the whole page


Im not a pro at this by any means. I tried following a few youtubes on this and was able to get the columns to work fine with paragraph tags. Though when I go with a ul > li tag. The image wants to take the whole space.

Im not really sure what the cause is here. Whats most perplexing is that it looks like the li / image has a right margin of the whole space. Even when I set it to zero.

When I inspect the element - that margin says 0 0 0 0 but mousing over I see it takes the whole page...

Code below ...

<html>
<head>
    <meta charset="utf-8">
    <title>Layout Test</title>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="css/960.css">
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/style.css">

<body>
    <div class="header">
        <h1>This is a test</h1>
    </div>
        <div class="container_12">

            <div class="grid_4">

                    <ul>
                        <li><a href="#"><img src="img/1.jpg"></a></li>
                        <li><a href="#"><img src="img/2.jpg"></a></li>
                        <li><a href="#"><img src="img/3.jpg"></a></li>
                        <li><a href="#"><img src="img/4.jpg"></a></li>
                        <li><a href="#"><img src="img/5.jpg"></a></li>
                        <li><a href="#"><img src="img/6.jpg"></a></li>
                    </ul>   

            </div>




</div>
</body>
</head>
</html>

Solution

  • li are block level elements and they should take the whole right space, unless you make it inline by display: inline; in css property. then if you want the li to float to right or left you could do float: right/left; all in the li css property