Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7866927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:33:51+00:00 2026-06-03T00:33:51+00:00

I am trying to create something like this: But I have problems beacuse it

  • 0

I am trying to create something like this:

https://i.stack.imgur.com/aabn9.png

But I have problems beacuse it has to be made inside a foreach loop.

This is how I have it right now but it aint like the image I dont know how to do it like my image.

 @{
       int counter = 1;

          @foreach (IconsViewModel items in Model.AllIconsModel)
          {

              <a href="#" class="box"></a>
              <p>@(counter++)</p>

          }               
  }

CSS:

.box

{
    border: 1px solid black;
    width: 65px;
    height: 65px;
    float: left;     
}

I will be very thankful if somone would help me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:33:52+00:00Added an answer on June 3, 2026 at 12:33 am

    You have to define html like this:

    HTML

    <div class="wrapper">
        <div class="parent">
          <a href="" ></a>
          <p></p>
        </div>
        <div class="parent">
          <a href="" ></a>
          <p></p>
        </div>
    </div>
    

    CSS

    .wrapper{
      text-align:center;
    }
    
    .parent{
      display:inline-block;
      *display:inline;/*For IE*/
      *zoom:1;
      text-align:center;
    }
    .box
    {
        border: 1px solid black;
        width: 65px;
        height: 65px;
        display: block;     
    }
    

    JS

     @{
           int counter = 1;
    
              @foreach (IconsViewModel items in Model.AllIconsModel)
              {
                  <div class="parent" >
                    <a href="#" class="box"></a>
                    <p>@(counter++)</p>
                  </div>
              }               
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create something like this as i have done it in
I am trying to create an array which will follow something like this array(
I'm trying to create a animation by scrolling the page, something like this: $(function()
I am trying to create something in Perl that is basically like the Unix
I'm trying to create a cmdlet with the name Invoke-Something. But I cannot find
So i feel like a noob but this has been baffling me or hours
I am trying to create something on a webpage that allows my users to
I am trying to create something that uses the idea of the UIPopOverController, I
I am trying to create something to hold global site-wide settings in our ASP.NET
I am a beginning javascript programmer. I am trying to create something similar to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.