3 replies [Last post]
toneeh
toneeh's picture
Offline
newbie
Australia
Last seen: 9 years 1 week ago
Australia
Timezone: GMT+11
Joined: 2013-01-13
Posts: 3
Points: 4

Hi guys,

This ones been bothering me for a while now and I can't see to work out the CSS to make this align from left to right. I'll post a few screenshots and my code / css to show you whats happening.

Basically, if I add things to my database and retrieve them on the website, it will display them vertically no problems. But I want it to fill left to right before going down .. if you understand what I mean Tongue

Here is the bit of code I am using, just something small for now I need to populate it once I get the layout right... it's in CSHTML, from webmatrix.

    @foreach(var row in db.Query(odd)){

  • @row.Name
  • @row.Name
    }

    The CSS:
    ul#products{

    list-style: none;
    display: inline;
    }
    ul#products li{
    float: left;
    display: inline;
    }

    ul#products li a {
    background: none;
    color: black;
    text-decoration: none;
    }

    Attached are two screenshots, the "aligned inventory" I changed via paint, and is how I want it to look.. the other one is the current broken one.

  • AttachmentSize
    unaligned inventory.jpg63.96 KB
    aligned inventory.jpg80.22 KB
    toneeh
    toneeh's picture
    Offline
    newbie
    Australia
    Last seen: 9 years 1 week ago
    Australia
    Timezone: GMT+11
    Joined: 2013-01-13
    Posts: 3
    Points: 4

    Sorry, just need to fix it up

    Sorry, just need to fix it up a bit...not displaying properly

        <ul id="products">
    @foreach(var row in db.Query(odd)){  
    <li><a href="[email protected]"> @row.Name</a></li><br/>
    <li><a href="~/[email protected]"><img src="pictures/Shirts/@row.Image" width="200" height="200" alt="@row.Name" </li>
           }      
         </ul> 

    toneeh
    toneeh's picture
    Offline
    newbie
    Australia
    Last seen: 9 years 1 week ago
    Australia
    Timezone: GMT+11
    Joined: 2013-01-13
    Posts: 3
    Points: 4

    Nevermind, i figured it out

    Nevermind, i figured it out Smile

    gary.turner
    gary.turner's picture
    Offline
    Moderator
    Dallas
    Last seen: 47 weeks 1 day ago
    Dallas
    Timezone: GMT-6
    Joined: 2004-06-25
    Posts: 9776
    Points: 3858

    Oh?

    And what was your solution? It's just good netiquette to post your answer; others may need to know also.

    cheers,

    gary

    If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.