Home  >  Article  >  Web Front-end  >  I want to display 5 articles in one line_html/css_WEB-ITnose

I want to display 5 articles in one line_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:20:111049browse

At first, I would wrap the line after 6 articles. In order to align it, I filled in spaces after each article. I found that I could fill in other matching articles, but I couldn’t fill in spaces.

Later I thought that this method is not very good. It seems that it can be controlled with css div. I am not familiar with this method. How should I do it? Can you help me write it down? ? Thank you




Below is my original method, I use c# razor view

    <div>        @foreach (var cat in Model.CateFather)        {            if (cat.IsMagazine.HasValue && cat.IsMagazine.Value)            {            @Html.ActionLink(cat.Name, "Magazine", "Lib",new { id = cat.ID }, new { target = "_blank", title = cat.Name });       //杂志类型            }            else            {            @Html.ActionLink(cat.Name, "Category", "Lib", new { id = cat.ID }, new { target = "_blank", title = cat.Name })  //一般分类            }            counter6 = counter6 + 1;            if (counter6 % 6 == 0)            {            <br />                counter6 = 0;            }            else            {                            int i = System.Text.Encoding.GetEncoding("gb2312").GetBytes(cat.Name).Length;                string strSpace = "";                if (30 > i)                {                               @strSpace.PadRight(30 - i, '-');                }                            }        }    </div>


Reply to the discussion (solution )

Now I use div layout, and I have a new problem, look at the picture below
Why does the piece in the red box go to the right? I want it to be below
Please tell me How to write?



The following is html

Or do it yourself

Just add a c5cb8a28f524bbbc603a70cba75ca556 🎜>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn